sabir-akhadov-localstack commented on code in PR #2620:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/2620#discussion_r4335011719


##########
src/parser/mod.rs:
##########
@@ -14241,11 +14241,10 @@ impl<'a> Parser<'a> {
                         }
                     }
 
-                    // If the last segment was a number, we must check that 
it's followed by whitespace,
-                    // otherwise foo-123a will be parsed as `foo-123` with the 
alias `a`.
+                    // A word or number butted onto a trailing number glues 
into it, as in `foo-123a`.
                     if requires_whitespace {
-                        let token = self.next_token();
-                        if !matches!(token.token, Token::EOF | 
Token::Whitespace(_)) {
+                        let token = self.peek_token_no_skip();
+                        if matches!(token.token, Token::Word(_) | 
Token::Number(_, false)) {

Review Comment:
   `foo`x`` and `foo-bar`x`` parse with alias `x` on main and here, so pinning 
`foo-1`x`` as an error is inconsistent; a quoted word cannot glue into the 
identifier, so `Token::Word(Word { quote_style: None, .. })` would make the 
numeric segment behave like the word segment.



-- 
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]

Reply via email to