From 37da50876a17f7d40628707203edfc727e0e7b85 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Mon, 1 Nov 2021 19:06:29 -0400 Subject: [AST] Bugfix for type parsing --- src/tparse/tree-value.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/tparse') diff --git a/src/tparse/tree-value.go b/src/tparse/tree-value.go index d851fdc..330194d 100644 --- a/src/tparse/tree-value.go +++ b/src/tparse/tree-value.go @@ -376,7 +376,7 @@ func parseType(tokens *[]Token, tok, max int, param bool) (Node, int) { var tmp Node switch t.Type { case AUGMENT: - if t.Data != "~" && t.Data != "`" { + if t.Data != "~" { errOut("Error: unexpected augment token when parsing type", t) } tmp.Data = t @@ -388,8 +388,15 @@ func parseType(tokens *[]Token, tok, max int, param bool) (Node, int) { tmp.Data = t tok++ } - + out.Sub = append(out.Sub, tmp) + + if param && (*tokens)[tok].Data == "`" { + tmp = Node{(*tokens)[tok], false, []Node{}} + out.Sub = append(out.Sub, tmp) + tok++ + } + return out, tok case DEFWORD: if (*tokens)[tok+1].Data == "(" { -- cgit v1.2.3