Skip to content

Commit 88c5507

Browse files
committed
Add comment to explain LParen behavior
- plus, flip the if/else to positive equality for simplicity
1 parent 91b2db8 commit 88c5507

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/parser/mod.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9833,11 +9833,13 @@ impl<'a> Parser<'a> {
98339833
Ok(DataType::AnyType)
98349834
}
98359835
Keyword::TABLE => {
9836-
if self.peek_token() != Token::LParen {
9837-
Ok(DataType::Table(None))
9838-
} else {
9836+
// an LParen after the TABLE keyword indicates that table columns are being defined
9837+
// whereas no LParen indicates an anonymous table expression will be returned
9838+
if self.peek_token() == Token::LParen {
98399839
let columns = self.parse_returns_table_columns()?;
98409840
Ok(DataType::Table(Some(columns)))
9841+
} else {
9842+
Ok(DataType::Table(None))
98419843
}
98429844
}
98439845
Keyword::SIGNED => {

0 commit comments

Comments
 (0)