Skip to content

Commit 991fd19

Browse files
committed
Stop nesting match in parse_compound_identifier (4/8)
1 parent 8c34799 commit 991fd19

File tree

1 file changed

+15
-21
lines changed

1 file changed

+15
-21
lines changed

src/sqlparser.rs

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -951,30 +951,24 @@ impl Parser {
951951
loop {
952952
let token = &self.next_token();
953953
match token {
954-
Some(token) => match token {
955-
Token::SQLWord(s) => {
956-
if expect_identifier {
957-
expect_identifier = false;
958-
idents.push(s.to_string());
959-
} else {
960-
self.prev_token();
961-
break;
962-
}
963-
}
964-
token if token == separator => {
965-
if expect_identifier {
966-
return parser_err!(format!("Expecting identifier, found {:?}", token));
967-
} else {
968-
expect_identifier = true;
969-
continue;
970-
}
971-
}
972-
_ => {
954+
Some(Token::SQLWord(s)) => {
955+
if expect_identifier {
956+
expect_identifier = false;
957+
idents.push(s.to_string());
958+
} else {
973959
self.prev_token();
974960
break;
975961
}
976-
},
977-
None => {
962+
}
963+
Some(token) if token == separator => {
964+
if expect_identifier {
965+
return parser_err!(format!("Expecting identifier, found {:?}", token));
966+
} else {
967+
expect_identifier = true;
968+
continue;
969+
}
970+
}
971+
_ => {
978972
self.prev_token();
979973
break;
980974
}

0 commit comments

Comments
 (0)