summaryrefslogtreecommitdiff
path: root/src/parse.go
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2021-11-19 01:39:05 -0500
committerKyle Gunger <kgunger12@gmail.com>2021-11-19 01:39:05 -0500
commit96cf52263053db6bc3069c9fbc664ed0725ac41e (patch)
treef3dca802ad7413a9aa614e73fc593a0e28e6fdfb /src/parse.go
parent8cdf25536841a698ad6229f73cdf8ef5ccc1e5fa (diff)
Some refactoring, clearing out eval
+ Fixed BuildRoot + Refactored world.go - Deleted most of eval, I'm going to re-do it.
Diffstat (limited to 'src/parse.go')
-rw-r--r--src/parse.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/parse.go b/src/parse.go
index 7849857..79bf013 100644
--- a/src/parse.go
+++ b/src/parse.go
@@ -18,6 +18,7 @@ package main
import "fmt"
import "tparse"
+import "texec"
import "flag"
import "os"
@@ -35,14 +36,19 @@ func main() {
return
}
- tokens := tparse.TokenizeFile(*inputFile)
+
switch *writeLevel {
case 0:
+ tokens := tparse.TokenizeFile(*inputFile)
fd.WriteString(fmt.Sprint(tokens) + "\n")
case 1:
+ tokens := tparse.TokenizeFile(*inputFile)
tree := tparse.MakeTree(&tokens, *inputFile)
fd.WriteString(fmt.Sprint(tree) + "\n")
+ case 2:
+ root := texec.BuildRoot(*inputFile)
+ fd.WriteString(fmt.Sprint(root) + "\n")
}
fd.Close()