mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-12 06:52:02 +00:00
Merge pull request #95 from benesch/hex-literals
Support hexadecimal string literals
This commit is contained in:
commit
b12fb34f3d
4 changed files with 36 additions and 3 deletions
|
@ -239,7 +239,10 @@ impl Parser {
|
|||
expr: Box::new(self.parse_subexpr(Self::PLUS_MINUS_PREC)?),
|
||||
})
|
||||
}
|
||||
Token::Number(_) | Token::SingleQuotedString(_) | Token::NationalStringLiteral(_) => {
|
||||
Token::Number(_)
|
||||
| Token::SingleQuotedString(_)
|
||||
| Token::NationalStringLiteral(_)
|
||||
| Token::HexStringLiteral(_) => {
|
||||
self.prev_token();
|
||||
self.parse_sql_value()
|
||||
}
|
||||
|
@ -1042,6 +1045,7 @@ impl Parser {
|
|||
Token::NationalStringLiteral(ref s) => {
|
||||
Ok(Value::NationalStringLiteral(s.to_string()))
|
||||
}
|
||||
Token::HexStringLiteral(ref s) => Ok(Value::HexStringLiteral(s.to_string())),
|
||||
_ => parser_err!(format!("Unsupported value: {:?}", t)),
|
||||
},
|
||||
None => parser_err!("Expecting a value, but found EOF"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue