Skip to content

Commit 486f85a

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

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
@@ -9851,11 +9851,13 @@ impl<'a> Parser<'a> {
98519851
Ok(DataType::AnyType)
98529852
}
98539853
Keyword::TABLE => {
9854-
if self.peek_token() != Token::LParen {
9855-
Ok(DataType::Table(None))
9856-
} else {
9854+
// an LParen after the TABLE keyword indicates that table columns are being defined
9855+
// whereas no LParen indicates an anonymous table expression will be returned
9856+
if self.peek_token() == Token::LParen {
98579857
let columns = self.parse_returns_table_columns()?;
98589858
Ok(DataType::Table(Some(columns)))
9859+
} else {
9860+
Ok(DataType::Table(None))
98599861
}
98609862
}
98619863
Keyword::SIGNED => {

0 commit comments

Comments
 (0)