Move reader and printer packages to the core package

This commit is contained in:
Sameer Rahmani 2020-11-15 19:33:16 +00:00
parent 95ec031ce6
commit 38baf577bb
3 changed files with 6 additions and 11 deletions

View File

@ -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:

View File

@ -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"

View File

@ -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"