diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2021-10-30 14:35:53 -0400 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2021-10-30 14:35:53 -0400 |
commit | 051f325d54aad24233714aabb1d616411aea1d05 (patch) | |
tree | 43b41c883fc0061978181db3196b9d9492f02bde /src/tparse/tree-value.go | |
parent | 65eafdcefd5179eb767ce8886e19f30ea701385b (diff) |
[AST] Return and type fixes
+ Allow types to include the . operator
+ Allow returns to have more than one value
Diffstat (limited to 'src/tparse/tree-value.go')
-rw-r--r-- | src/tparse/tree-value.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tparse/tree-value.go b/src/tparse/tree-value.go index edca103..554edcd 100644 --- a/src/tparse/tree-value.go +++ b/src/tparse/tree-value.go @@ -362,7 +362,16 @@ func parseType(tokens *[]Token, tok, max int, param bool) (Node, int) { case DEFWORD: if (*tokens)[tok+1].Data == "(" { tmp, tok = parseTypeParams(tokens, tok, max) + } else if (*tokens)[tok+1].Data == "." { + tmp.Data = t + out.Sub = append(out.Sub, tmp) + tok++ + continue + } else { + tmp.Data = t + tok++ } + out.Sub = append(out.Sub, tmp) return out, tok |