Skip to content

Commit

Permalink
Started working on user-defined trait impls
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacShelton committed Dec 16, 2024
1 parent c0d0d4f commit d5c5b9c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lexer/identifier_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ pub enum TokenKind {
PragmaKeyword,
PubKeyword,
TraitKeyword,
ImplKeyword,
ForKeyword,
Member,
Add,
Subtract,
Expand Down Expand Up @@ -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("'-'"),
Expand Down Expand Up @@ -303,6 +307,8 @@ impl TokenKind {
| TokenKind::PragmaKeyword
| TokenKind::PubKeyword
| TokenKind::TraitKeyword
| TokenKind::ImplKeyword
| TokenKind::ForKeyword
| TokenKind::OpenAngle
| TokenKind::Comma
| TokenKind::Colon
Expand Down

0 comments on commit d5c5b9c

Please sign in to comment.