iffyio commented on code in PR #2426:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/2426#discussion_r3811178172
##########
src/tokenizer.rs:
##########
@@ -1372,12 +1372,24 @@ impl<'a> Tokenizer<'a> {
ch.is_ascii_digit() || is_number_separator(ch, next_ch)
});
+ if self.dialect.supports_numeric_literal_underscores()
+ && chars.peek() == Some(&'_')
+ {
+ return self.tokenizer_error(chars.location(),
"Unexpected character '_'");
+ }
Review Comment:
i couldn't see if/why this block was necessary given `is_number_separator`
checks with a lookahead - is there a fallthrough code that captures the
trailing underscore somewhere below?
I have the same comments about some of the other similar diffs below, is
there a way to solve this in a more holistic manner vs the individual if checks
- the latter is unclear/not-obvious how they interact with the rest of the code
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]