feat: ?? 空值合并运算符 — a ?? b → if a!=0 {a} else {b}

Token(76): +TOK_QMARK_QMARK, 优先级 PREC_COALESCE=15 (||之上, |>之下)
parser 去糖为 if-expr, 零 sema/codegen 改动

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-06-07 14:18:48 +08:00
parent caf17e16fc
commit f7710ede9d
5 changed files with 23 additions and 1 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ typedef enum {
TOK_LBRACKET, TOK_RBRACKET,
TOK_COMMA, TOK_COLON, TOK_SEMICOLON, TOK_ASSIGN,
// 特殊
TOK_DOT, TOK_COLON_COLON, TOK_HASH,
TOK_DOT, TOK_COLON_COLON, TOK_HASH, TOK_QMARK_QMARK,
TOK_EOF, TOK_ERROR,
} TokenKind;