diff --git a/src/lexer/identifier_state.rs b/src/lexer/identifier_state.rs index 161294b..e77ab3a 100644 --- a/src/lexer/identifier_state.rs +++ b/src/lexer/identifier_state.rs @@ -46,6 +46,7 @@ impl IdentifierState { "trait" => TokenKind::TraitKeyword, "impl" => TokenKind::ImplKeyword, "for" => TokenKind::ForKeyword, + "is" => TokenKind::IsKeyword, _ => TokenKind::Identifier(identifier), } .at(self.start_source) diff --git a/src/token.rs b/src/token.rs index e158531..25a59d1 100644 --- a/src/token.rs +++ b/src/token.rs @@ -84,6 +84,7 @@ pub enum TokenKind { PubKeyword, TraitKeyword, ImplKeyword, + IsKeyword, ForKeyword, Member, Add, @@ -178,6 +179,7 @@ impl Display for TokenKind { TokenKind::TraitKeyword => f.write_str("'trait' keyword"), TokenKind::ImplKeyword => f.write_str("'impl' keyword"), TokenKind::ForKeyword => f.write_str("'for' keyword"), + TokenKind::IsKeyword => f.write_str("'is' keyword"), TokenKind::Member => f.write_str("'.'"), TokenKind::Add => f.write_str("'+'"), TokenKind::Subtract => f.write_str("'-'"), @@ -309,6 +311,7 @@ impl TokenKind { | TokenKind::TraitKeyword | TokenKind::ImplKeyword | TokenKind::ForKeyword + | TokenKind::IsKeyword | TokenKind::OpenAngle | TokenKind::Comma | TokenKind::Colon