summaryrefslogtreecommitdiff
path: root/tnslc/parse
diff options
context:
space:
mode:
authorKai Gunger <kgunger12@gmail.com>2026-03-16 00:26:51 -0400
committerKai Gunger <kgunger12@gmail.com>2026-03-16 00:26:51 -0400
commit6fcd9b168c2667c3e757bce7f68377954917224a (patch)
treebcafe3329f9c1da4746ebbf90fadc8a03884725e /tnslc/parse
parent411733084c3f64872657e6803ecf4380c907626e (diff)
Various fixesorigin
Diffstat (limited to 'tnslc/parse')
-rw-r--r--tnslc/parse/ast.tnsl16
1 files changed, 16 insertions, 0 deletions
diff --git a/tnslc/parse/ast.tnsl b/tnslc/parse/ast.tnsl
index f9ad1f9..24773f2 100644
--- a/tnslc/parse/ast.tnsl
+++ b/tnslc/parse/ast.tnsl
@@ -204,6 +204,20 @@ int errors_shown = 0
return true
;/
+# Canonical operation order from strongest (lowest number prec) to weakest (highest number prec)
+# Parenthesis or function call done before any of these
+# 0: deref - (`)
+# 1: member - (.)
+# 2: refer - (~)
+# 3: inc/dec - (++ --)
+# 4: bit shift - (<< >>)
+# 5: len prefix op - (len)
+# 6: mul/div - (* / %)
+# 7: add/sub - (+ -)
+# 8: bitwise ops - (! & | ^ !& !| !^)
+# 9: comparison - (== < > <== >== !== !< !>)
+# 10: boolean - (&& || ^^ !&& !|| !^^)
+# 11: assignment - variants of =
/; _op_order(~uint8 op) [int]
int l = utils.strlen(op)
@@ -255,6 +269,8 @@ int errors_shown = 0
return 5
;; else if (op{1} == '=')
return 9
+ ;; else if (op{2} == '=')
+ return 11
;/
return 10
;/