Immutable parser (Tokenize borrow strings cont) (#2098)
Some checks failed
Rust / codestyle (push) Has been cancelled
Rust / lint (push) Has been cancelled
Rust / benchmark-lint (push) Has been cancelled
Rust / compile (push) Has been cancelled
Rust / docs (push) Has been cancelled
Rust / compile-no-std (push) Has been cancelled
Rust / test (beta) (push) Has been cancelled
Rust / test (nightly) (push) Has been cancelled
Rust / test (stable) (push) Has been cancelled

Co-authored-by: Eyal Leshem <eyal@satoricyber.com>
This commit is contained in:
eyalleshem 2025-12-18 06:27:50 +02:00 committed by GitHub
parent b098976cab
commit c6933bb8ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 658 additions and 716 deletions

View file

@ -39,7 +39,7 @@ fn custom_prefix_parser() -> Result<(), ParserError> {
is_identifier_part(ch)
}
fn parse_prefix(&self, parser: &mut Parser) -> Option<Result<Expr, ParserError>> {
fn parse_prefix(&self, parser: &Parser) -> Option<Result<Expr, ParserError>> {
if parser.consume_token(&Token::Number("1".to_string(), false)) {
Some(Ok(Expr::Value(Value::Null.with_empty_span())))
} else {
@ -72,7 +72,7 @@ fn custom_infix_parser() -> Result<(), ParserError> {
fn parse_infix(
&self,
parser: &mut Parser,
parser: &Parser,
expr: &Expr,
_precedence: u8,
) -> Option<Result<Expr, ParserError>> {
@ -110,7 +110,7 @@ fn custom_statement_parser() -> Result<(), ParserError> {
is_identifier_part(ch)
}
fn parse_statement(&self, parser: &mut Parser) -> Option<Result<Statement, ParserError>> {
fn parse_statement(&self, parser: &Parser) -> Option<Result<Statement, ParserError>> {
if parser.parse_keyword(Keyword::SELECT) {
for _ in 0..3 {
let _ = parser.next_token();