feat: 添加 const 关键字支持
- 在 TokenFactory 类中的 KEYWORDS 集合中添加了 "const" 关键字 - 此修改为编译器增加了对常量声明的支持,扩展了语言的功能
This commit is contained in:
parent
c44f8a4630
commit
3b39e9059b
@ -28,7 +28,7 @@ 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");
|
"cond", "step", "globals", "break", "continue", "const");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 内置类型名称集合,如 int、string 等。
|
* 内置类型名称集合,如 int、string 等。
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user