mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-09-01 11:47:20 +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,8 +951,7 @@ impl Parser {
|
||||||
loop {
|
loop {
|
||||||
let token = &self.next_token();
|
let token = &self.next_token();
|
||||||
match token {
|
match token {
|
||||||
Some(token) => match token {
|
Some(Token::SQLWord(s)) => {
|
||||||
Token::SQLWord(s) => {
|
|
||||||
if expect_identifier {
|
if expect_identifier {
|
||||||
expect_identifier = false;
|
expect_identifier = false;
|
||||||
idents.push(s.to_string());
|
idents.push(s.to_string());
|
||||||
|
@ -961,7 +960,7 @@ impl Parser {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
token if token == separator => {
|
Some(token) if token == separator => {
|
||||||
if expect_identifier {
|
if expect_identifier {
|
||||||
return parser_err!(format!("Expecting identifier, found {:?}", token));
|
return parser_err!(format!("Expecting identifier, found {:?}", token));
|
||||||
} else {
|
} else {
|
||||||
|
@ -973,11 +972,6 @@ impl Parser {
|
||||||
self.prev_token();
|
self.prev_token();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
|
||||||
None => {
|
|
||||||
self.prev_token();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(ASTNode::SQLCompoundIdentifier(idents))
|
Ok(ASTNode::SQLCompoundIdentifier(idents))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue