Simplify parse_create() a little

Don't need the duplicate `columns.push()` + we advance the tokenizer,
so no need to peek first.
This commit is contained in:
Nickolay Ponomarev 2019-01-31 03:41:39 +03:00
parent 89602dc044
commit a0f625b949

View file

@ -571,9 +571,6 @@ impl Parser {
}; };
debug!("default: {:?}", default); debug!("default: {:?}", default);
match self.peek_token() {
Some(Token::Comma) => {
self.next_token();
columns.push(SQLColumnDef { columns.push(SQLColumnDef {
name: column_name.as_sql_ident(), name: column_name.as_sql_ident(),
data_type: data_type, data_type: data_type,
@ -582,17 +579,9 @@ impl Parser {
is_unique, is_unique,
default, default,
}); });
} match self.next_token() {
Some(Token::Comma) => {}
Some(Token::RParen) => { Some(Token::RParen) => {
self.next_token();
columns.push(SQLColumnDef {
name: column_name.as_sql_ident(),
data_type: data_type,
allow_null,
is_primary,
is_unique,
default,
});
break; break;
} }
other => { other => {