diff --git a/src/lexer/identifier_state.rs b/src/lexer/identifier_state.rs index 7cc064d8..161294b7 100644 --- a/src/lexer/identifier_state.rs +++ b/src/lexer/identifier_state.rs @@ -44,6 +44,8 @@ impl IdentifierState { "pragma" => TokenKind::PragmaKeyword, "pub" => TokenKind::PubKeyword, "trait" => TokenKind::TraitKeyword, + "impl" => TokenKind::ImplKeyword, + "for" => TokenKind::ForKeyword, _ => TokenKind::Identifier(identifier), } .at(self.start_source) diff --git a/src/token.rs b/src/token.rs index 075205ec..e158531d 100644 --- a/src/token.rs +++ b/src/token.rs @@ -83,6 +83,8 @@ pub enum TokenKind { PragmaKeyword, PubKeyword, TraitKeyword, + ImplKeyword, + ForKeyword, Member, Add, Subtract, @@ -174,6 +176,8 @@ impl Display for TokenKind { TokenKind::PragmaKeyword => f.write_str("'pragma' keyword"), TokenKind::PubKeyword => f.write_str("'pub' keyword"), TokenKind::TraitKeyword => f.write_str("'trait' keyword"), + TokenKind::ImplKeyword => f.write_str("'impl' keyword"), + TokenKind::ForKeyword => f.write_str("'for' keyword"), TokenKind::Member => f.write_str("'.'"), TokenKind::Add => f.write_str("'+'"), TokenKind::Subtract => f.write_str("'-'"), @@ -303,6 +307,8 @@ impl TokenKind { | TokenKind::PragmaKeyword | TokenKind::PubKeyword | TokenKind::TraitKeyword + | TokenKind::ImplKeyword + | TokenKind::ForKeyword | TokenKind::OpenAngle | TokenKind::Comma | TokenKind::Colon