From eed8e74d18235bc61ed66435c935bbbc5337f953 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Mon, 1 Nov 2021 21:57:25 -0400 Subject: [EXEC] parseFile --- src/exec.go | 2 +- src/texec/worldbuilder.go | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/exec.go b/src/exec.go index dbdbf72..79584ce 100644 --- a/src/exec.go +++ b/src/exec.go @@ -28,5 +28,5 @@ func main() { world := texec.BuildWorld(*inputFile) - texec.EvalTNSL(&world, *progFlags) + texec.EvalTNSL(world, *progFlags) } \ No newline at end of file diff --git a/src/texec/worldbuilder.go b/src/texec/worldbuilder.go index 54f87f3..8e5648f 100644 --- a/src/texec/worldbuilder.go +++ b/src/texec/worldbuilder.go @@ -16,13 +16,21 @@ package texec -import "tparse" +import ( + "tparse" + "path" +) /** worldbuilder.go - take in a file name and construct a TWorld based on it. */ +func parseFile(p string) tparse.Node { + tokens := tparse.TokenizeFile(p) + return tparse.MakeTree(&(tokens), p) +} + // BuildWorld creates a new TWorld by parsing a main file and recursively parsing imports. -func BuildWorld(file string) *TWorld { +func BuildWorld(file string) TWorld { return nil } -- cgit v1.2.3