[fine] Parse is expression, partially
This commit is contained in:
parent
afa4812074
commit
ba5b37f5ff
4 changed files with 98 additions and 23 deletions
|
|
@ -48,6 +48,7 @@ pub enum TokenKind {
|
|||
If,
|
||||
Import,
|
||||
In,
|
||||
Is,
|
||||
Let,
|
||||
New,
|
||||
Or,
|
||||
|
|
@ -297,6 +298,9 @@ impl<'a> Tokens<'a> {
|
|||
if ident == "in" {
|
||||
return TokenKind::In;
|
||||
}
|
||||
if ident == "is" {
|
||||
return TokenKind::Is;
|
||||
}
|
||||
}
|
||||
'l' => {
|
||||
if ident == "let" {
|
||||
|
|
@ -593,6 +597,8 @@ mod tests {
|
|||
(58, New, "new")
|
||||
);
|
||||
|
||||
test_tokens!(more_more_keywords, "in is", (0, In, "in"), (3, Is, "is"));
|
||||
|
||||
test_tokens!(
|
||||
strings,
|
||||
r#"'this is a string that\'s great!\r\n' "foo's" 'bar"s' "#,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue