From 9222a5a73923407f6c0ab2c0d40bb58114b7a6ec Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Fri, 8 Apr 2022 02:20:14 -0400 Subject: [EVAL] Control Flow + Added support for loop and if + Added support for break statements inside CF blocks + Fixed a bug with floats not parsing in specific cases --- src/tparse/tree-statement.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/tparse') diff --git a/src/tparse/tree-statement.go b/src/tparse/tree-statement.go index b4f891b..c88b102 100644 --- a/src/tparse/tree-statement.go +++ b/src/tparse/tree-statement.go @@ -241,9 +241,10 @@ func keywordStatement(tokens *[]Token, tok, max int) (Node, int) { tok++ // Check for a numerical value and dip case "return": - if (*tokens)[tok].Type != DELIMIT || (*tokens)[tok].Data == "{" || (*tokens)[tok].Data == "(" { - tmp, tok = parseValueList(tokens, tok, max) + if (*tokens)[tok].Type == LINESEP || (*tokens)[tok].Data == ";/" { + return out, tok } + tmp, tok = parseValue(tokens, tok, max) case "alloc", "salloc", "realloc": // Parse value list tmp, tok = parseValueList(tokens, tok, max) -- cgit v1.2.3