mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-30 18:57:21 +00:00
Stop nesting match
in parse_compound_identifier (4/8)
This commit is contained in:
parent
8c3479969f
commit
991fd19b87
1 changed files with 15 additions and 21 deletions
|
@ -951,30 +951,24 @@ impl Parser {
|
|||
loop {
|
||||
let token = &self.next_token();
|
||||
match token {
|
||||
Some(token) => match token {
|
||||
Token::SQLWord(s) => {
|
||||
if expect_identifier {
|
||||
expect_identifier = false;
|
||||
idents.push(s.to_string());
|
||||
} else {
|
||||
self.prev_token();
|
||||
break;
|
||||
}
|
||||
}
|
||||
token if token == separator => {
|
||||
if expect_identifier {
|
||||
return parser_err!(format!("Expecting identifier, found {:?}", token));
|
||||
} else {
|
||||
expect_identifier = true;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
Some(Token::SQLWord(s)) => {
|
||||
if expect_identifier {
|
||||
expect_identifier = false;
|
||||
idents.push(s.to_string());
|
||||
} else {
|
||||
self.prev_token();
|
||||
break;
|
||||
}
|
||||
},
|
||||
None => {
|
||||
}
|
||||
Some(token) if token == separator => {
|
||||
if expect_identifier {
|
||||
return parser_err!(format!("Expecting identifier, found {:?}", token));
|
||||
} else {
|
||||
expect_identifier = true;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
self.prev_token();
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue