summaryrefslogtreecommitdiff
path: root/src/tparse/tree-statement.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/tparse/tree-statement.go')
-rw-r--r--src/tparse/tree-statement.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/tparse/tree-statement.go b/src/tparse/tree-statement.go
index 6a5b6e3..5c6d912 100644
--- a/src/tparse/tree-statement.go
+++ b/src/tparse/tree-statement.go
@@ -193,7 +193,13 @@ func keywordStatement(tokens *[]Token, tok, max int) (Node, int) {
out.Sub = append(out.Sub, tmp)
tok++
if (*tokens)[tok].Data == "(" {
- tmp, tok = parseValueList(tokens, tok + 1, max)
+ mx := findClosing(tokens, tok)
+
+ if mx < 0 {
+ errOut("Failed to find closing paren when parsing a struct def", (*tokens)[tok])
+ }
+
+ tmp, tok = parseValueList(tokens, tok + 1, mx)
out.Sub = append(out.Sub, tmp)
tok++
}