feat: 新增关键字支持
- 在 TokenFactory 类中添加了关键字 "new" 的支持 - 此更新扩展了编译器的词汇分析能力,使其能够识别和处理新的关键字
This commit is contained in:
parent
584e226051
commit
0c2a888e86
@ -28,7 +28,9 @@ public class TokenFactory {
|
|||||||
private static final Set<String> KEYWORDS = Set.of
|
private static final Set<String> KEYWORDS = Set.of
|
||||||
("module", "function", "params", "returns", "body", "end",
|
("module", "function", "params", "returns", "body", "end",
|
||||||
"if", "then", "else", "loop", "declare", "return", "import", "init",
|
"if", "then", "else", "loop", "declare", "return", "import", "init",
|
||||||
"cond", "step", "globals", "break", "continue", "const");
|
"cond", "step", "globals", "break", "continue", "const",
|
||||||
|
"new"
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 内置类型名称集合,如 int、string 等。
|
* 内置类型名称集合,如 int、string 等。
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user