summaryrefslogtreecommitdiff
path: root/src/tparse
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2022-04-08 02:20:14 -0400
committerKyle Gunger <kgunger12@gmail.com>2022-04-08 02:20:14 -0400
commit9222a5a73923407f6c0ab2c0d40bb58114b7a6ec (patch)
tree9bc0be024035c2d49a48111b9eaaba3ae44bf7ba /src/tparse
parent2a30bcfb777acab52b4883c6fd44e04ae54b7f8b (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')
-rw-r--r--src/tparse/tree-statement.go5
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)