try and balance precedence for prefix ops

This commit is contained in:
2026-07-11 14:15:40 +10:00
parent 75396b95f9
commit 5e67dc960f
2 changed files with 7 additions and 9 deletions

View File

@@ -51,9 +51,9 @@ typedef enum {
PRECEDENCE_SUM = 6,
PRECEDENCE_PRODUCT = 7,
PRECEDENCE_EXPONENT = 8,
PRECEDENCE_PREFIX = 9,
PRECEDENCE_CALL = 10,
PRECEDENCE_SET = 11,
PRECEDENCE_SET = 9,
PRECEDENCE_PREFIX = 10,
PRECEDENCE_CALL = 11,
PRECEDENCE_INDEX = 12,
PRECEDENCE_DOT = 13
} CometPrecedenceType;

View File

@@ -1,10 +1,8 @@
func main() -> int {
mut int x = (2 + 3) * (4 + 5)
int y = x + 5
int[*] x = new int[3]
int[*] y = new int[3]
if (x + 5 == y) {
x = 45
}
x:#y = 13
return x + 5
return 0
}