@@ -515,11 +515,7 @@ tableReference
515515tablePrimary
516516 : KW_TABLE ? tablePath systemTimePeriod?
517517 | viewPath systemTimePeriod?
518- | KW_LATERAL KW_TABLE LR_BRACKET (
519- (functionNameWithParams LR_BRACKET functionParam (COMMA functionParam)* RR_BRACKET )
520- | reservedKeywordsNoParamsUsedAsFuncName
521- | functionNameAndParams
522- ) RR_BRACKET
518+ | KW_LATERAL KW_TABLE LR_BRACKET functionCallExpression RR_BRACKET
523519 | KW_LATERAL ? LR_BRACKET queryStatement RR_BRACKET
524520 | KW_UNNEST LR_BRACKET expression RR_BRACKET
525521 ;
@@ -751,6 +747,12 @@ valueExpression
751747 | left=valueExpression comparisonOperator right=valueExpression # comparison
752748 ;
753749
750+ functionCallExpression
751+ : reservedKeywordsNoParamsUsedAsFuncName
752+ | functionNameAndParams
753+ | functionNameWithParams LR_BRACKET (setQuantifier? functionParam (COMMA functionParam)*)? RR_BRACKET
754+ ;
755+
754756primaryExpression
755757 : KW_CASE whenClause+ (KW_ELSE elseExpression=expression)? KW_END # searchedCase
756758 | KW_CASE value=expression whenClause+ (KW_ELSE elseExpression=expression)? KW_END # simpleCase
@@ -764,13 +766,7 @@ primaryExpression
764766 | uid DOT ASTERISK_SIGN # star
765767 // | LR_BRACKET namedExpression (COMMA namedExpression)+ RR_BRACKET #rowConstructor
766768 | LR_BRACKET queryStatement RR_BRACKET # subqueryExpression
767- | (
768- reservedKeywordsNoParamsUsedAsFuncName
769- | functionNameAndParams
770- | (
771- functionNameWithParams LR_BRACKET (setQuantifier? functionParam (COMMA functionParam)*)? RR_BRACKET
772- )
773- ) # functionCall
769+ | functionCallExpression # functionCall
774770 // | identifier '->' expression #lambda
775771 // | '(' identifier (',' identifier)+ ')' '->' expression #lambda
776772 | value=primaryExpression LS_BRACKET index=valueExpression RS_BRACKET # subscript
0 commit comments