Skip to content

Commit 01ff6c4

Browse files
committed
ensure comments are properly preserved
1 parent 266d8a2 commit 01ff6c4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/parser.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1966,7 +1966,11 @@ impl Parser {
19661966

19671967
// Check if the recently consumed '(' started a derived table, in which case we've
19681968
// parsed the subquery, followed by the closing ')', and the alias of the derived
1969-
// table. In the example above this is case (3), or another nested join (2).
1969+
// table. In the example above this is case (3).
1970+
//
1971+
// A parsing error from `parse_derived_table_factor` indicates that the '(' we've
1972+
// recently consumed does not start a derived table (cases 1, 2, or 4). Ignore the
1973+
// error and back up to where we after the opening '('.
19701974
if let Some(parsed) =
19711975
self.maybe_parse(|parser| parser.parse_derived_table_factor(NotLateral))
19721976
{

0 commit comments

Comments
 (0)