[fine] Implement the wildcard pattern
This commit is contained in:
parent
e0721d09fc
commit
65ec2d4cca
5 changed files with 104 additions and 25 deletions
|
|
@ -57,6 +57,7 @@ pub enum TokenKind {
|
|||
Select,
|
||||
Selff,
|
||||
True,
|
||||
Underscore,
|
||||
While,
|
||||
Yield,
|
||||
}
|
||||
|
|
@ -351,6 +352,11 @@ impl<'a> Tokens<'a> {
|
|||
return TokenKind::Yield;
|
||||
}
|
||||
}
|
||||
'_' => {
|
||||
if ident == "_" {
|
||||
return TokenKind::Underscore;
|
||||
}
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
|
||||
|
|
@ -605,10 +611,11 @@ mod tests {
|
|||
|
||||
test_tokens!(
|
||||
more_more_keywords,
|
||||
"in is match",
|
||||
"in is match _",
|
||||
(0, In, "in"),
|
||||
(3, Is, "is"),
|
||||
(6, Match, "match")
|
||||
(6, Match, "match"),
|
||||
(12, Underscore, "_")
|
||||
);
|
||||
|
||||
test_tokens!(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue