test exprs

This commit is contained in:
TcMits
2025-08-07 15:40:36 +07:00
parent e93e50ad67
commit 2796121e07
4 changed files with 1057 additions and 10 deletions

1
parser/README.md Normal file
View File

@@ -0,0 +1 @@
TODO

View File

@@ -231,7 +231,7 @@ impl<'a> Lexer<'a> {
Token {
value: &self.input[start..self.offset],
token_type: Some(TokenType::TK_RP),
token_type: Some(TokenType::TK_PTR),
}
}
_ => Token {
@@ -258,12 +258,16 @@ impl<'a> Lexer<'a> {
break; // End of block comment
}
None => {
return Err(Error::UnterminatedBlockComment((self.offset, 1).into()))
return Err(Error::UnterminatedBlockComment(
(self.offset, 1).into(),
))
}
_ => {}
}
}
None => return Err(Error::UnterminatedBlockComment((self.offset, 1).into())),
None => {
return Err(Error::UnterminatedBlockComment((self.offset, 1).into()))
}
_ => unreachable!(), // We should not reach here
}
}
@@ -665,14 +669,14 @@ mod tests {
b"->".as_slice(),
Token {
value: b"->".as_slice(),
token_type: Some(TokenType::TK_RP),
token_type: Some(TokenType::TK_PTR),
},
),
(
b"->>".as_slice(),
Token {
value: b"->>".as_slice(),
token_type: Some(TokenType::TK_RP),
token_type: Some(TokenType::TK_PTR),
},
),
(

View File

@@ -1,5 +1,5 @@
pub mod error;
pub mod token;
pub mod ast;
pub mod error;
pub mod lexer;
pub mod parser;
pub mod token;

File diff suppressed because it is too large Load Diff