Skip to content

Commit cc748c3

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

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
@@ -9854,11 +9854,13 @@ impl<'a> Parser<'a> {
98549854
Ok(DataType::AnyType)
98559855
}
98569856
Keyword::TABLE => {
9857-
if self.peek_token() != Token::LParen {
9858-
Ok(DataType::Table(None))
9859-
} else {
9857+
// an LParen after the TABLE keyword indicates that table columns are being defined
9858+
// whereas no LParen indicates an anonymous table expression will be returned
9859+
if self.peek_token() == Token::LParen {
98609860
let columns = self.parse_returns_table_columns()?;
98619861
Ok(DataType::Table(Some(columns)))
9862+
} else {
9863+
Ok(DataType::Table(None))
98629864
}
98639865
}
98649866
Keyword::SIGNED => {

0 commit comments

Comments
 (0)