summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2024-04-29 18:40:25 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2024-04-29 18:40:25 +0200
commitb3df12b910f8df19095b7b9af25eef30a39bffc7 (patch)
treea8e09263fb59f88d70cd5c2ac01c072ca3b17837
parent68a85fcf5e3b7e1bee56d68d4c5c587bb1aaccf6 (diff)
downloadrebel-b3df12b910f8df19095b7b9af25eef30a39bffc7.tar
rebel-b3df12b910f8df19095b7b9af25eef30a39bffc7.zip
rebel-parse: token: reserve "let" and "mut" keywords
-rw-r--r--crates/rebel-parse/src/grammar/tokenize.rs2
-rw-r--r--crates/rebel-parse/src/token.rs2
2 files changed, 4 insertions, 0 deletions
diff --git a/crates/rebel-parse/src/grammar/tokenize.rs b/crates/rebel-parse/src/grammar/tokenize.rs
index a696852..4f4da2b 100644
--- a/crates/rebel-parse/src/grammar/tokenize.rs
+++ b/crates/rebel-parse/src/grammar/tokenize.rs
@@ -5,6 +5,8 @@ pub use rules::*;
static KEYWORDS: phf::Map<&'static str, Keyword> = phf::phf_map! {
"true" => Keyword::True,
"false" => Keyword::False,
+ "let" => Keyword::Let,
+ "mut" => Keyword::Mut,
"fetch" => Keyword::Fetch,
"task" => Keyword::Task,
"struct" => Keyword::Struct,
diff --git a/crates/rebel-parse/src/token.rs b/crates/rebel-parse/src/token.rs
index bfa9c42..3c1745a 100644
--- a/crates/rebel-parse/src/token.rs
+++ b/crates/rebel-parse/src/token.rs
@@ -11,6 +11,8 @@ pub enum Token<'a> {
pub enum Keyword {
True,
False,
+ Let,
+ Mut,
Fetch,
Task,
Struct,