Skip to content

Commit

Permalink
🚨 (parser): Fix compiler warnings
Browse files Browse the repository at this point in the history
semver: chore
  • Loading branch information
Somfic committed Jun 14, 2024
1 parent 34c9146 commit 5e4c2bc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/files.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{collections::HashMap, ops::Index};
use std::collections::HashMap;

#[derive(Default)]
pub struct Files<'a> {
Expand Down
2 changes: 1 addition & 1 deletion src/parser/expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use super::{
ast::{Expression, UnaryOperation},
lookup::BindingPower,
macros::{expect_expression, expect_token_value, expect_tokens, expect_valid_token},
Diagnostic, Parser,
Parser,
};
use crate::{
diagnostic::Error,
Expand Down
15 changes: 5 additions & 10 deletions src/parser/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,11 @@ macro_rules! expect_tokens {
let lexeme: Option<&crate::scanner::lexeme::Lexeme> = $parser.lexemes.get(i);

match lexeme {
Some(lexeme) => {
match lexeme {
crate::scanner::lexeme::Lexeme::Valid(token) => {
if token.token_type == $token_type {
tokens.push(token.clone());
valid += 1;
}
}
_ => {}
};
Some(crate::scanner::lexeme::Lexeme::Valid(token)) => {
if token.token_type == $token_type {
tokens.push(token.clone());
valid += 1;
}
}
_ => {}
};
Expand Down

0 comments on commit 5e4c2bc

Please sign in to comment.