Skip to content

Commit 12a3ff5

Browse files
committed
Deal with warnings for Ellipsis and Rarrow
1 parent 86ebe8b commit 12a3ff5

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

parser/src/lexer.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ impl<'input> Lexer<'input> {
5656
let mut keywords: HashMap<String, Tok> = HashMap::new();
5757

5858
// Alphabetical keywords:
59+
keywords.insert(String::from("..."), Tok::Ellipsis);
5960
keywords.insert(String::from("False"), Tok::False);
6061
keywords.insert(String::from("None"), Tok::None);
6162
keywords.insert(String::from("True"), Tok::True);
@@ -433,6 +434,10 @@ impl<'input> Lexer<'input> {
433434
self.next_char();
434435
return Some(Ok((tok_start, Tok::MinusEqual, self.location + 1)));
435436
}
437+
Some('>') => {
438+
self.next_char();
439+
return Some(Ok((tok_start, Tok::Rarrow, self.location + 1)));
440+
}
436441
_ => return Some(Ok((tok_start, Tok::Minus, self.location + 1))),
437442
}
438443
}

parser/src/token.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub enum Tok {
5454
At,
5555
AtEqual,
5656
Rarrow,
57-
Ellipses,
57+
Ellipsis,
5858

5959
// Keywords (alphabetically):
6060

0 commit comments

Comments
 (0)