Skip to content

Commit 0fcac14

Browse files
committed
Eat for comma.
1 parent 7edf3c8 commit 0fcac14

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

compiler/parser/src/lexer.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -690,12 +690,12 @@ where
690690
fn consume_normal(&mut self) -> Result<(), LexicalError> {
691691
// Check if we have some character:
692692
if let Some(c) = self.window[0] {
693-
if self.is_identifier_start(c) {
694-
let identifier = self.lex_identifier()?;
695-
self.emit(identifier);
696-
} else {
697-
self.consume_character(c)?;
698-
}
693+
if self.is_identifier_start(c) {
694+
let identifier = self.lex_identifier()?;
695+
self.emit(identifier);
696+
} else {
697+
self.consume_character(c)?;
698+
}
699699
} else {
700700
// We reached end of file.
701701
let tok_pos = self.get_pos();
@@ -1039,10 +1039,7 @@ where
10391039
}
10401040
}
10411041
',' => {
1042-
let tok_start = self.get_pos();
1043-
self.next_char();
1044-
let tok_end = self.get_pos();
1045-
self.emit((tok_start, Tok::Comma, tok_end));
1042+
self.eat_single_char(Tok::Comma);
10461043
}
10471044
'.' => {
10481045
if let Some('0'..='9') = self.window[1] {
@@ -1102,7 +1099,7 @@ where
11021099
}
11031100
}
11041101
_ => {
1105-
if is_emoji_presentation(c) {
1102+
if is_emoji_presentation(c) {
11061103
let tok_start = self.get_pos();
11071104
self.next_char();
11081105
let tok_end = self.get_pos();

0 commit comments

Comments
 (0)