diff options
Diffstat (limited to 'src/texec')
-rw-r--r-- | src/texec/eval.go | 26 | ||||
-rw-r--r-- | src/texec/world.go | 1 | ||||
-rw-r--r-- | src/texec/worldbuilder.go | 4 |
3 files changed, 29 insertions, 2 deletions
diff --git a/src/texec/eval.go b/src/texec/eval.go index b6c0020..93cbfdb 100644 --- a/src/texec/eval.go +++ b/src/texec/eval.go @@ -157,6 +157,32 @@ func equateType(a, b TType) bool { return true; } +// Generate a TType from a 'type' node +func getType(t tparse.Node) TType { + out := TType{} + + return out +} + +// Value generation + +func getStringLiteral(v tparse.Node) []byte { + +} + +func getCharLiteral(v tparse.Node) byte { + +} + +func getIntLiteral(v tparse.Node) int { + +} + +// Get a literal value from nodes. Must specify type of literal to generate. +func getLiteral(v tparse.Node, t TType) interface{} { + +} + //################# //# Runtime funcs # //################# diff --git a/src/texec/world.go b/src/texec/world.go index 83c50fd..b1c6def 100644 --- a/src/texec/world.go +++ b/src/texec/world.go @@ -49,6 +49,7 @@ type TContext struct { type TModule struct { Name string Artifacts []tparse.Node + Defs VarMap Sub []TModule } diff --git a/src/texec/worldbuilder.go b/src/texec/worldbuilder.go index d85f1ac..023c730 100644 --- a/src/texec/worldbuilder.go +++ b/src/texec/worldbuilder.go @@ -37,10 +37,10 @@ import ( // Returns generated value and general "type" of value (string, number) func evalPreLiteral(n tparse.Node) string { - r := tparse.StringAsRunes(n.Data.Data) + r := []rune(n.Data.Data) l := len(r) if r[0] == '"' || r[0] == '\'' { - return tparse.RunesAsString(r[1:l - 1]) + return string(r[1:l - 1]) } return "" } |