diff --git a/src/NHibernate/Hql/Ast/ANTLR/Hql.g b/src/NHibernate/Hql/Ast/ANTLR/Hql.g index 281e997138f..364c9142711 100644 --- a/src/NHibernate/Hql/Ast/ANTLR/Hql.g +++ b/src/NHibernate/Hql/Ast/ANTLR/Hql.g @@ -628,12 +628,11 @@ aggregateArgument ; aggregateDistinctAll - : ( distinctAll aggregateArgument ) => (distinctAll aggregateArgument) - | aggregateArgument + : ( distinctAll? aggregateArgument ) ; distinctAll - : ( DISTINCT | ALL ) + : {input.LA(1) == DISTINCT || input.LA(1) == ALL}? ( DISTINCT | ALL ) ; //## collection: ( OPEN query CLOSE ) | ( 'elements'|'indices' OPEN path CLOSE );