|
|
|
@ -104,6 +104,8 @@ pub enum TokenKind {
|
|
|
|
|
StarEqual, |
|
|
|
|
/// "/="
|
|
|
|
|
SlashEqual, |
|
|
|
|
/// "=>"
|
|
|
|
|
ArrowRight, |
|
|
|
|
/// "("
|
|
|
|
|
BraceOpen, |
|
|
|
|
/// ")"
|
|
|
|
@ -145,6 +147,8 @@ pub enum Keyword {
|
|
|
|
|
Boolean, |
|
|
|
|
Struct, |
|
|
|
|
New, |
|
|
|
|
Match, |
|
|
|
|
Default, |
|
|
|
|
Unknown, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -244,6 +248,10 @@ impl Cursor<'_> {
|
|
|
|
|
self.bump(); |
|
|
|
|
Equals |
|
|
|
|
} |
|
|
|
|
'>' => { |
|
|
|
|
self.bump(); |
|
|
|
|
ArrowRight |
|
|
|
|
} |
|
|
|
|
_ => Assign, |
|
|
|
|
}, |
|
|
|
|
':' => Colon, |
|
|
|
@ -368,6 +376,8 @@ impl Cursor<'_> {
|
|
|
|
|
c if c == "continue" => Keyword::Continue, |
|
|
|
|
c if c == "struct" => Keyword::Struct, |
|
|
|
|
c if c == "new" => Keyword::New, |
|
|
|
|
c if c == "match" => Keyword::Match, |
|
|
|
|
c if c == "default" => Keyword::Default, |
|
|
|
|
_ => Keyword::Unknown, |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|