diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2022-04-09 20:39:33 -0400 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2022-04-09 20:39:33 -0400 |
commit | 3a9dbb4b5491a6ae813e4632bf17a5b5f00e8e0c (patch) | |
tree | 20400861be34786a731a54fd55030dcc76709fc6 /src | |
parent | 427f4120f77d55ca04ac559747651469e3e86260 (diff) |
[PARSE] Hotfix for array indexing
Diffstat (limited to 'src')
-rw-r--r-- | src/tparse/tree-value.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/tparse/tree-value.go b/src/tparse/tree-value.go index 1c7e99c..25982ff 100644 --- a/src/tparse/tree-value.go +++ b/src/tparse/tree-value.go @@ -213,6 +213,10 @@ func parseBinaryOp(tokens *[]Token, tok, max int) (Node) { } } else if t.Type == AUGMENT { order, prs := ORDER[t.Data] + if prs == false || curl > 0 || brak > 0 || parn > 0 { + continue + } + if t.Data == "-" { _, prs := ORDER[(*tokens)[tok - 1].Data] if prs || (*tokens)[tok - 1].Data == "return" { @@ -220,9 +224,7 @@ func parseBinaryOp(tokens *[]Token, tok, max int) (Node) { } else if order > highOrder { high, highOrder = tok, order } - } else if prs == false || curl > 0 || brak > 0 || parn > 0 { - continue - } else if order > highOrder { + } else if order > highOrder { high, highOrder = tok, order } // TODO: Add in case for the "is" operator @@ -544,4 +546,4 @@ func isTypeThenValue(tokens *[]Token, tok, max int) (bool) { } return stage == 2 -}
\ No newline at end of file +} |