Support hexadecimal string literals

This commit is contained in:
Nikhil Benesch 2019-05-29 18:18:35 -04:00
parent 2308c1c6f7
commit eba3983268
No known key found for this signature in database
GPG key ID: F7386C5DEADABA7F
4 changed files with 36 additions and 3 deletions

View file

@ -238,7 +238,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()
}
@ -1037,6 +1040,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"),