From a3e0d8d47b47a5b3ec4cb0f40a7411091af900a6 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Sun, 31 Oct 2021 00:06:27 -0400 Subject: [AST] another bugfix for void types --- src/tparse/tree-value.go | 13 +++++++++---- 1 file 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 } -- cgit v1.2.3