Move reader and printer packages to the core package
This commit is contained in:
parent
95ec031ce6
commit
38baf577bb
|
@ -23,13 +23,11 @@ import (
|
|||
"fmt"
|
||||
|
||||
"github.com/chzyer/readline"
|
||||
"serene-lang.org/bootstrap/pkg/printer"
|
||||
"serene-lang.org/bootstrap/pkg/reader"
|
||||
"serene-lang.org/bootstrap/pkg/runtime"
|
||||
)
|
||||
|
||||
func rep(rt *runtime.Runtime, line string) {
|
||||
ast, err := reader.ReadString(line)
|
||||
ast, err := ReadString(line)
|
||||
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
|
@ -37,8 +35,8 @@ func rep(rt *runtime.Runtime, line string) {
|
|||
|
||||
if rt.IsDebugMode() {
|
||||
fmt.Println("\n### DEBUG ###")
|
||||
printer.Print(rt, ast)
|
||||
fmt.Println("#############\n")
|
||||
Print(rt, ast)
|
||||
fmt.Print("#############\n\n")
|
||||
}
|
||||
|
||||
result, err := Eval(rt, ast)
|
||||
|
@ -47,7 +45,7 @@ func rep(rt *runtime.Runtime, line string) {
|
|||
return
|
||||
}
|
||||
|
||||
printer.Print(rt, result)
|
||||
Print(rt, result)
|
||||
}
|
||||
|
||||
/** TODO:
|
||||
|
|
|
@ -16,8 +16,7 @@ You should have received a copy of the GNU General Public License
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// Package printer contains helper functions to printout AST and exprs
|
||||
package printer
|
||||
package core
|
||||
|
||||
import (
|
||||
"fmt"
|
|
@ -16,9 +16,7 @@ You should have received a copy of the GNU General Public License
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// Package reader provides a set of functions to read forms from several
|
||||
// different mediums
|
||||
package reader
|
||||
package core
|
||||
|
||||
import (
|
||||
"serene-lang.org/bootstrap/pkg/parser"
|
Loading…
Reference in New Issue