summaryrefslogtreecommitdiff
path: root/src/tparse
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2021-10-31 00:06:27 -0400
committerKyle Gunger <kgunger12@gmail.com>2021-10-31 00:06:27 -0400
commita3e0d8d47b47a5b3ec4cb0f40a7411091af900a6 (patch)
tree07decd29f0e7a0bcad98b6aad2e52a70db0f0a25 /src/tparse
parent61bd3b82b9d493bfb35fe5fef625c17ebf0c1fcb (diff)
[AST] another bugfix for void types
Diffstat (limited to 'src/tparse')
-rw-r--r--src/tparse/tree-value.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/tparse/tree-value.go b/src/tparse/tree-value.go
index 843ef0c..abb785b 100644
--- a/src/tparse/tree-value.go
+++ b/src/tparse/tree-value.go
@@ -273,8 +273,13 @@ func parseValue(tokens *[]Token, tok, max int) (Node, int) {
parn--
case "/;":
+ _, prs := ORDER[(*tokens)[tok - 1].Data]
+ if !prs && block == 0 {
+ goto PARSEBIN
+ }
block++
case ";/":
+
if block > 0 {
block--
}
@@ -329,8 +334,8 @@ func parseTypeParams(tokens *[]Token, tok, max int) (Node, int) {
tmp.Data.Data = "[]"
} else if t.Data == ")" || t.Data == "]" || t.Data == "}" {
// End of type
- tok++
- goto VOIDDONE
+ //errOutV("Test", tok, max, t)
+ goto DONE
} else {
errOut("Error: unexpected delimeter when parsing type", t)
}
@@ -340,13 +345,13 @@ func parseTypeParams(tokens *[]Token, tok, max int) (Node, int) {
default:
// End of type
- goto VOIDDONE
+ goto DONE
}
out.Sub = append(out.Sub, tmp)
}
- VOIDDONE:
+ DONE:
return out, tok
}