From b3df12b910f8df19095b7b9af25eef30a39bffc7 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 29 Apr 2024 18:40:25 +0200 Subject: rebel-parse: token: reserve "let" and "mut" keywords --- crates/rebel-parse/src/grammar/tokenize.rs | 2 ++ crates/rebel-parse/src/token.rs | 2 ++ 2 files changed, 4 insertions(+) (limited to 'crates/rebel-parse') 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, -- cgit v1.2.3