recognize "const" as token

This commit is contained in:
evan-schott 2023-09-22 13:01:58 -07:00
parent 4b01d41d05
commit 38fdb43bd3
3 changed files with 6 additions and 0 deletions

View File

@ -386,6 +386,7 @@ impl Token {
"block" => Token::Block,
"bool" => Token::Bool,
"console" => Token::Console,
"const" => Token::Const,
"constant" => Token::Constant,
"else" => Token::Else,
"false" => Token::False,

View File

@ -114,6 +114,7 @@ pub enum Token {
AssertEq,
AssertNeq,
Console,
Const,
Constant,
Else,
Finalize,
@ -154,6 +155,7 @@ pub const KEYWORD_TOKENS: &[Token] = &[
Token::AssertNeq,
Token::Bool,
Token::Console,
Token::Const,
Token::Constant,
Token::Else,
Token::False,
@ -210,6 +212,7 @@ impl Token {
Token::Block => sym::block,
Token::Bool => sym::bool,
Token::Console => sym::console,
Token::Const => sym::Const,
Token::Constant => sym::constant,
Token::Else => sym::Else,
Token::False => sym::False,
@ -343,6 +346,7 @@ impl fmt::Display for Token {
AssertEq => write!(f, "assert_eq"),
AssertNeq => write!(f, "assert_neq"),
Console => write!(f, "console"),
Const => write!(f, "const"),
Constant => write!(f, "constant"),
Else => write!(f, "else"),
Finalize => write!(f, "finalize"),

View File

@ -235,6 +235,7 @@ symbols! {
assert_neq,
caller,
console,
Const: "const",
constant,
decrement,
Else: "else",