feat: 新增关键字支持

- 在 TokenFactory 类中添加了关键字 "new" 的支持
- 此更新扩展了编译器的词汇分析能力,使其能够识别和处理新的关键字
This commit is contained in:
Luke 2025-08-29 18:21:46 +08:00
parent 584e226051
commit 0c2a888e86

View File

@ -28,7 +28,9 @@ public class TokenFactory {
private static final Set<String> KEYWORDS = Set.of
("module", "function", "params", "returns", "body", "end",
"if", "then", "else", "loop", "declare", "return", "import", "init",
"cond", "step", "globals", "break", "continue", "const");
"cond", "step", "globals", "break", "continue", "const",
"new"
);
/**
* 内置类型名称集合 intstring