Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9586,14 +9586,14 @@ impl<'a> Parser<'a> {
tok @ Token::Colon | tok @ Token::AtSign => {
// Not calling self.parse_identifier(false)? because only in placeholder we want to check numbers as idfentifies
// This because snowflake allows numbers as placeholders
let next_token = self.next_token();
let next_token = self.next_token_no_skip().unwrap_or(&EOF_TOKEN).clone();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand the intent correctly is this saying that e.g. SELECT :foo is to be parsed as a placeholder but SELECT : foo should not? If so I think it would be good to mention that in a comment. Also can we add a test case to demonstrate this change?

let ident = match next_token.token {
Token::Word(w) => Ok(w.into_ident(next_token.span)),
Token::Number(w, false) => Ok(Ident::new(w)),
Token::Number(w, false) => Ok(Ident::with_span(next_token.span, w)),
_ => self.expected("placeholder", next_token),
}?;
let placeholder = tok.to_string() + &ident.value;
ok_value(Value::Placeholder(placeholder))
Ok(Value::Placeholder(tok.to_string() + &ident.value)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a test case for this to avoid future regressions? we have some span test cases here that we could add to

.with_span(Span::new(span.start, ident.span.end)))
}
unexpected => self.expected(
"a value",
Expand Down