From dc8f1a06f086bda90e90a5386d4619d54efb1d0d Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Sat, 11 Dec 2021 23:32:16 -0500 Subject: [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. --- src/tparse/tree-value.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/tparse/tree-value.go') 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) } -- cgit v1.2.3