Skip to content

Commit

Permalink
Added 'is' keyword in preparation for sum types
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacShelton committed Dec 21, 2024
1 parent 72818c8 commit 5d67677
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lexer/identifier_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ pub enum TokenKind {
PubKeyword,
TraitKeyword,
ImplKeyword,
IsKeyword,
ForKeyword,
Member,
Add,
Expand Down Expand Up @@ -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("'-'"),
Expand Down Expand Up @@ -309,6 +311,7 @@ impl TokenKind {
| TokenKind::TraitKeyword
| TokenKind::ImplKeyword
| TokenKind::ForKeyword
| TokenKind::IsKeyword
| TokenKind::OpenAngle
| TokenKind::Comma
| TokenKind::Colon
Expand Down

0 comments on commit 5d67677

Please sign in to comment.