summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2021-11-01 19:06:29 -0400
committerKyle Gunger <kgunger12@gmail.com>2021-11-01 19:06:29 -0400
commit37da50876a17f7d40628707203edfc727e0e7b85 (patch)
tree0aeb656893e1aa63c374d08c2e1eb6d19be13f8a
parentd228a388e5c95c703cff9f3050bb47e19078484a (diff)
[AST] Bugfix for type parsing
-rw-r--r--src/tparse/tree-value.go11
1 files changed, 9 insertions, 2 deletions
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 == "(" {