@@ -2633,7 +2633,7 @@ ReturningClause ReturningClause():
26332633}
26342634{
26352635 ( keyword=<K_RETURNING> | keyword=<K_RETURN> )
2636- [ outputAliases = ReturningOutputAliasList() ]
2636+ [ LOOKAHEAD(2) outputAliases = ReturningOutputAliasList() ]
26372637 selectItems = SelectItemsList()
26382638
26392639 [
@@ -7387,14 +7387,14 @@ JsonFunction JsonArrayBody() : {
73877387
73887388 [
73897389 LOOKAHEAD(2) <K_FORMAT> <K_JSON> { functionExpression.setUsingFormatJson( true ); }
7390- [ <K_ENCODING> encoding = JsonEncoding() { functionExpression.setEncoding(encoding); } ]
7390+ [ LOOKAHEAD(2) <K_ENCODING> encoding = JsonEncoding() { functionExpression.setEncoding(encoding); } ]
73917391 ]
73927392 (
73937393 ","
73947394 expression=Expression() { functionExpression = new JsonFunctionExpression( expression ); result.add( functionExpression ); }
73957395 [
73967396 LOOKAHEAD(2) <K_FORMAT> <K_JSON> { functionExpression.setUsingFormatJson( true ); }
7397- [ <K_ENCODING> encoding = JsonEncoding() { functionExpression.setEncoding(encoding); } ]
7397+ [ LOOKAHEAD(2) <K_ENCODING> encoding = JsonEncoding() { functionExpression.setEncoding(encoding); } ]
73987398 ]
73997399 )*
74007400 )*
@@ -7587,7 +7587,7 @@ JsonFunction JsonExistsBody() : {
75877587 LOOKAHEAD({ getToken(1).kind == S_IDENTIFIER && getToken(1).image.equalsIgnoreCase("PASSING") })
75887588 JsonKeyword("PASSING")
75897589 expression = Expression() { result.addPassingExpression(expression); }
7590- ( "," expression = Expression() { result.addPassingExpression(expression); } )*
7590+ ( LOOKAHEAD(2) "," expression = Expression() { result.addPassingExpression(expression); } )*
75917591 ]
75927592
75937593 [
@@ -7619,7 +7619,7 @@ JsonFunction JsonValueBody() : {
76197619 LOOKAHEAD({ getToken(1).kind == S_IDENTIFIER && getToken(1).image.equalsIgnoreCase("PASSING") })
76207620 JsonKeyword("PASSING")
76217621 expression = Expression() { result.addPassingExpression(expression); }
7622- ( "," expression = Expression() { result.addPassingExpression(expression); } )*
7622+ ( LOOKAHEAD(2) "," expression = Expression() { result.addPassingExpression(expression); } )*
76237623 ]
76247624
76257625 [ <K_RETURNING> dataType = ColDataType() { result.setReturningType(dataType); } ]
@@ -7662,6 +7662,7 @@ JsonFunction JsonQueryBody() : {
76627662 JsonFunction.JsonOnResponseBehavior additionalOnEmptyBehavior;
76637663 JsonFunction.JsonOnResponseBehavior additionalOnErrorBehavior;
76647664 StringBuilder additionalBuilder;
7665+ boolean hasPassingClause = false;
76657666}
76667667{
76677668 "("
@@ -7671,9 +7672,9 @@ JsonFunction JsonQueryBody() : {
76717672
76727673 [
76737674 LOOKAHEAD({ getToken(1).kind == S_IDENTIFIER && getToken(1).image.equalsIgnoreCase("PASSING") })
7674- JsonKeyword("PASSING")
7675+ JsonKeyword("PASSING") { hasPassingClause = true; }
76757676 expression = Expression() { result.addPassingExpression(expression); }
7676- ( "," expression = Expression() { result.addPassingExpression(expression); } )*
7677+ ( LOOKAHEAD(2) "," expression = Expression() { result.addPassingExpression(expression); } )*
76777678 ]
76787679
76797680 [
@@ -7744,6 +7745,7 @@ JsonFunction JsonQueryBody() : {
77447745 ]
77457746
77467747 (
7748+ LOOKAHEAD(2, { !hasPassingClause })
77477749 ","
77487750 {
77497751 additionalReturningType = null;
@@ -8803,7 +8805,7 @@ JsonTableFunction.JsonTableColumnDefinition JsonTableColumnDefinition() : {
88038805 LOOKAHEAD({ getToken(1).kind == S_IDENTIFIER && getToken(1).image.equalsIgnoreCase("NESTED") })
88048806 JsonKeyword("NESTED")
88058807 { nestedColumnDefinition = new JsonTableFunction.JsonTableNestedColumnDefinition(); }
8806- [ <K_PATH> { nestedColumnDefinition.setPathKeyword(true); } ]
8808+ [ LOOKAHEAD(2) <K_PATH> { nestedColumnDefinition.setPathKeyword(true); } ]
88078809 expression = Expression() { nestedColumnDefinition.setPathExpression(expression); }
88088810 [ <K_AS> pathName = RelObjectName() { nestedColumnDefinition.setPathName(pathName); } ]
88098811 columnsClause = JsonTableColumnsClause() {
@@ -8892,6 +8894,7 @@ JsonTableFunction.JsonTablePlanTerm JsonTablePlanTerm() : {
88928894 term.setNestedPlanExpression(nestedPlanExpression);
88938895 }
88948896 |
8897+ LOOKAHEAD(2)
88958898 value = RelObjectName() {
88968899 term = new JsonTableFunction.JsonTablePlanTerm();
88978900 term.setName(value);
@@ -9831,7 +9834,7 @@ String ColumnsNamesListItem():
98319834{
98329835 ( item = RelObjectName() )
98339836 [ LOOKAHEAD(2) "(" tk = <S_LONG> ")" { item = item + "(" + tk.image + ")"; } ]
9834- [ (sortDirection = <K_ASC> | sortDirection = <K_DESC>) { item = item + " " + sortDirection.image; } ]
9837+ [ LOOKAHEAD( ( <K_ASC> | <K_DESC> ) ( "," | ")" ) ) (sortDirection = <K_ASC> | sortDirection = <K_DESC>) { item = item + " " + sortDirection.image; } ]
98359838 {
98369839 return item;
98379840 }
@@ -10294,7 +10297,7 @@ AlterExpression AlterExpression():
1029410297 constraints=AlterExpressionConstraintState() { alterExp.setConstraints(constraints); }
1029510298 [
1029610299 <K_USING> { alterExp.addParameters("USING"); }
10297- [ <K_INDEX> { alterExp.addParameters("INDEX"); } ]
10300+ [ LOOKAHEAD(2) <K_INDEX> { alterExp.addParameters("INDEX"); } ]
1029810301 sk4=RelObjectName() { alterExp.addParameters(sk4); }
1029910302 ]
1030010303 |
@@ -10440,7 +10443,7 @@ AlterExpression AlterExpression():
1044010443 columnNames=ColumnsNamesList() { alterExp.setUkColumns(columnNames); }
1044110444 [
1044210445 <K_USING> { alterExp.addParameters("USING"); }
10443- [ <K_INDEX> { alterExp.addParameters("INDEX"); } ]
10446+ [ LOOKAHEAD(2) <K_INDEX> { alterExp.addParameters("INDEX"); } ]
1044410447 sk4=RelObjectName() { alterExp.addParameters(sk4); }
1044510448 ]
1044610449 [ LOOKAHEAD(2) index = IndexWithComment(index) { alterExp.setIndex(index); } ]
@@ -10534,7 +10537,7 @@ AlterExpression AlterExpression():
1053410537 constraints=AlterExpressionConstraintState() { alterExp.setConstraints(constraints); }
1053510538 [
1053610539 <K_USING> { alterExp.addParameters("USING"); }
10537- [ <K_INDEX> { alterExp.addParameters("INDEX"); } ]
10540+ [ LOOKAHEAD(2) <K_INDEX> { alterExp.addParameters("INDEX"); } ]
1053810541 sk4=RelObjectName() { alterExp.addParameters(sk4); }
1053910542 ]
1054010543 [ LOOKAHEAD(2) index = IndexWithComment(index) { alterExp.setIndex(index); } ]
@@ -10570,7 +10573,7 @@ AlterExpression AlterExpression():
1057010573 constraints=AlterExpressionConstraintState() { alterExp.setConstraints(constraints); }
1057110574 [
1057210575 <K_USING> { alterExp.addParameters("USING"); }
10573- [ <K_INDEX> { alterExp.addParameters("INDEX"); } ]
10576+ [ LOOKAHEAD(2) <K_INDEX> { alterExp.addParameters("INDEX"); } ]
1057410577 sk4=RelObjectName() { alterExp.addParameters(sk4); }
1057510578 ]
1057610579 [ LOOKAHEAD(2) index = IndexWithComment(index) { alterExp.setIndex(index); } ]
0 commit comments