diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2021-12-11 23:32:16 -0500 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2021-12-11 23:32:16 -0500 |
commit | dc8f1a06f086bda90e90a5386d4619d54efb1d0d (patch) | |
tree | 7850d7ce6a7c77ab817779cd8bf4b2c122252069 /src/tparse/tree-value.go | |
parent | c3b9e4a8be18338ed5da223037d6259eaef54e8f (diff) |
[EVAL] Still needs some work
+ modules now define variables properly
+ fixed some bugs in eval.tnsl with type checking
~ Needs to support arrays and composites, but doesn't yet.
Diffstat (limited to 'src/tparse/tree-value.go')
-rw-r--r-- | src/tparse/tree-value.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tparse/tree-value.go b/src/tparse/tree-value.go index c44cdb6..1c7e99c 100644 --- a/src/tparse/tree-value.go +++ b/src/tparse/tree-value.go @@ -108,8 +108,8 @@ func parseUnaryOps(tokens *[]Token, tok, max int) (Node) { if vnode != &out { errOut("Composite values may not use unary operators.", out.Data) } - (*vnode) = Node{Token{10, "comp", 0, 0}, []Node{Node{}}} - (*vnode).Sub[0], tok = parseValueList(tokens, tok + 1, max) + (*vnode), tok = parseValueList(tokens, tok + 1, max) + (*vnode).Data.Data = "comp" val = true comp = true default: @@ -152,7 +152,7 @@ func parseUnaryOps(tokens *[]Token, tok, max int) (Node) { case "[": // Typecasting tmp, tok = parseTypeList(tokens, tok + 1, max) tmp.Data.Data = "cast" - case "{": // Array indexing + case "{": // Indexing if comp { errOut("Inline composite values can not be indexed.", t) } |