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