mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-09-03 12:47:21 +00:00
Remove Value::DoubleQuotedString
...and parser support for the corresponding token, as "..." in SQL[*] is not a literal string like we parse it - but a quoted identifier (which I intend to implement later). [*] in all the RBDMSes I know, except for sqlite which has complex rules in the name of "compatibility": https://www.sqlite.org/lang_keywords.html
This commit is contained in:
parent
efdbf0f9dc
commit
56884dc700
2 changed files with 1 additions and 10 deletions
|
@ -157,9 +157,7 @@ impl Parser {
|
|||
}
|
||||
}
|
||||
}
|
||||
Token::Number(_)
|
||||
| Token::SingleQuotedString(_)
|
||||
| Token::DoubleQuotedString(_) => {
|
||||
Token::Number(_) | Token::SingleQuotedString(_) => {
|
||||
self.prev_token();
|
||||
self.parse_sql_value()
|
||||
}
|
||||
|
@ -757,9 +755,6 @@ impl Parser {
|
|||
Token::SingleQuotedString(ref s) => {
|
||||
Ok(Value::SingleQuotedString(s.to_string()))
|
||||
}
|
||||
Token::DoubleQuotedString(ref s) => {
|
||||
Ok(Value::DoubleQuotedString(s.to_string()))
|
||||
}
|
||||
_ => parser_err!(format!("Unsupported value: {:?}", self.peek_token())),
|
||||
}
|
||||
}
|
||||
|
@ -791,7 +786,6 @@ impl Parser {
|
|||
pub fn parse_literal_string(&mut self) -> Result<String, ParserError> {
|
||||
match self.next_token() {
|
||||
Some(Token::SingleQuotedString(ref s)) => Ok(s.clone()),
|
||||
Some(Token::DoubleQuotedString(ref s)) => Ok(s.clone()),
|
||||
other => parser_err!(format!("Expected literal string, found {:?}", other)),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue