From 5e67dc960ff31adfaf0889a64397a0edb3b6e838 Mon Sep 17 00:00:00 2001 From: SpookyDervish Date: Sat, 11 Jul 2026 14:15:40 +1000 Subject: [PATCH] try and balance precedence for prefix ops --- src/parser.h | 6 +++--- test.comet | 10 ++++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/parser.h b/src/parser.h index ac388fd..2e1c460 100644 --- a/src/parser.h +++ b/src/parser.h @@ -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; diff --git a/test.comet b/test.comet index 344a98d..4cddf44 100644 --- a/test.comet +++ b/test.comet @@ -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 } \ No newline at end of file