summaryrefslogtreecommitdiff
path: root/src/tparse/tree-value.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/tparse/tree-value.go')
-rw-r--r--src/tparse/tree-value.go10
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
+}