mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-16 12:10:15 +00:00
Support MySQL Character Set Introducers (#788)
* MySQL Character Set Introducers * Documentation fix * Parsing string introducer from Token::word * Fixed lint * fix clippy --------- Co-authored-by: Maciej Skrzypkowski <maciej.skrzypkowski@satoricyber.com> Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
This commit is contained in:
parent
b31ede7733
commit
488e8a8156
4 changed files with 77 additions and 5 deletions
|
@ -546,12 +546,12 @@ impl<'a> Tokenizer<'a> {
|
|||
// identifier or keyword
|
||||
ch if self.dialect.is_identifier_start(ch) => {
|
||||
chars.next(); // consume the first char
|
||||
let s = self.tokenize_word(ch, chars);
|
||||
let word = self.tokenize_word(ch, chars);
|
||||
|
||||
// TODO: implement parsing of exponent here
|
||||
if s.chars().all(|x| ('0'..='9').contains(&x) || x == '.') {
|
||||
if word.chars().all(|x| ('0'..='9').contains(&x) || x == '.') {
|
||||
let mut inner_state = State {
|
||||
peekable: s.chars().peekable(),
|
||||
peekable: word.chars().peekable(),
|
||||
line: 0,
|
||||
col: 0,
|
||||
};
|
||||
|
@ -562,7 +562,8 @@ impl<'a> Tokenizer<'a> {
|
|||
s += s2.as_str();
|
||||
return Ok(Some(Token::Number(s, false)));
|
||||
}
|
||||
Ok(Some(Token::make_word(&s, None)))
|
||||
|
||||
Ok(Some(Token::make_word(&word, None)))
|
||||
}
|
||||
// single quoted string
|
||||
'\'' => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue