Skip to content

Commit

Permalink
small code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Animemchik authored and lpil committed Jan 15, 2024
1 parent fe9c1f1 commit e2cc424
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@

// Images
"images/**": true,
}
},
"commentTranslate.targetLanguage": "ru"
}
10 changes: 2 additions & 8 deletions compiler-core/src/parse/lexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,7 @@ where
fn consume_character(&mut self, c: char) -> Result<(), LexicalError> {
match c {
'@' => {
let tok_start = self.get_pos();
let _ = self.next_char();
let tok_end = self.get_pos();
self.emit((tok_start, Token::At, tok_end));
self.eat_single_char(Token::At);
}
'"' => {
let string = self.lex_string()?;
Expand Down Expand Up @@ -239,10 +236,7 @@ where
}
}
'%' => {
let tok_start = self.get_pos();
let _ = self.next_char();
let tok_end = self.get_pos();
self.emit((tok_start, Token::Percent, tok_end));
self.eat_single_char(Token::Percent);
}
'|' => {
let tok_start = self.get_pos();
Expand Down

0 comments on commit e2cc424

Please sign in to comment.