feat: 装饰器 #[attr] 语法 — parser 解析并跳过

Token(74): +TOK_HASH, lexer 识别 '#', parser 在 fn/struct/enum 前解析 #[ident]
语法就位, 后续可扩展存储属性到 AST 节点

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-06-07 14:00:42 +08:00
parent 443b22bdf1
commit 06c8773fac
4 changed files with 10 additions and 2 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ static const char* NAMES[] = {
[TOK_LBRACKET] = "[", [TOK_RBRACKET] = "]",
[TOK_COMMA] = ",", [TOK_COLON] = ":", [TOK_SEMICOLON] = ";",
[TOK_ASSIGN] = "=",
[TOK_DOT] = ".", [TOK_COLON_COLON] = "::",
[TOK_DOT] = ".", [TOK_COLON_COLON] = "::", [TOK_HASH] = "#",
[TOK_EOF] = "EOF", [TOK_ERROR] = "错误",
};