From e7c01fe5ebcb8e30c229a41125cdb318e9adcf8a Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Sat, 30 Oct 2021 02:22:35 -0400 Subject: [AST] Properly address "return" --- src/tparse/tree-statement.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/tparse/tree-statement.go') diff --git a/src/tparse/tree-statement.go b/src/tparse/tree-statement.go index 9280253..262bd6f 100644 --- a/src/tparse/tree-statement.go +++ b/src/tparse/tree-statement.go @@ -184,6 +184,10 @@ func keywordStatement(tokens *[]Token, tok, max int) (Node, int) { tmp.Data = (*tokens)[tok] tok++ // Check for a numerical value and dip + case "return": + if (*tokens)[tok].Type != DELIMIT || (*tokens)[tok].Data == "{" || (*tokens)[tok].Data == "(" { + tmp, tok = parseValue(tokens, tok, max) + } case "alloc", "salloc": // Parse value list tmp, tok = parseValueList(tokens, tok, max) -- cgit v1.2.3