Stop nesting match in parse_compound_identifier (4/8)

This commit is contained in:
Nickolay Ponomarev 2019-01-13 20:36:29 +03:00
parent 8c3479969f
commit 991fd19b87

View file

@ -951,30 +951,24 @@ 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()); } else {
} 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;
}
}
_ => {
self.prev_token(); self.prev_token();
break; 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(); self.prev_token();
break; break;
} }