diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2022-04-08 02:20:14 -0400 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2022-04-08 02:20:14 -0400 |
commit | 9222a5a73923407f6c0ab2c0d40bb58114b7a6ec (patch) | |
tree | 9bc0be024035c2d49a48111b9eaaba3ae44bf7ba /src/tparse/tree-statement.go | |
parent | 2a30bcfb777acab52b4883c6fd44e04ae54b7f8b (diff) |
[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
Diffstat (limited to 'src/tparse/tree-statement.go')
-rw-r--r-- | src/tparse/tree-statement.go | 5 |
1 files changed, 3 insertions, 2 deletions
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) |