diff --git a/src/main/antlr4/liquid/parser/v4/LiquidLexer.g4 b/src/main/antlr4/liquid/parser/v4/LiquidLexer.g4 index 88d2ae10..2ad827f1 100644 --- a/src/main/antlr4/liquid/parser/v4/LiquidLexer.g4 +++ b/src/main/antlr4/liquid/parser/v4/LiquidLexer.g4 @@ -16,16 +16,16 @@ lexer grammar LiquidLexer; } OutStart - : ( {stripSpacesAroundTags && stripSingleLine}? SpaceOrTab* '{{' - | {stripSpacesAroundTags && !stripSingleLine}? WhitespaceChar* '{{' + : ( SpaceOrTab* '{{' {stripSpacesAroundTags && stripSingleLine}? + | WhitespaceChar* '{{' {stripSpacesAroundTags && !stripSingleLine}? | WhitespaceChar* '{{-' | '{{' ) -> pushMode(IN_TAG) ; TagStart - : ( {stripSpacesAroundTags && stripSingleLine}? SpaceOrTab* '{%' - | {stripSpacesAroundTags && !stripSingleLine}? WhitespaceChar* '{%' + : ( SpaceOrTab* '{%' {stripSpacesAroundTags && stripSingleLine}? + | WhitespaceChar* '{%' {stripSpacesAroundTags && !stripSingleLine}? | WhitespaceChar* '{%-' | '{%' ) -> pushMode(IN_TAG) @@ -49,16 +49,16 @@ mode IN_TAG; TagStart2 : '{%' -> pushMode(IN_TAG); OutEnd - : ( {stripSpacesAroundTags && stripSingleLine}? '}}' SpaceOrTab* LineBreak? - | {stripSpacesAroundTags && !stripSingleLine}? '}}' WhitespaceChar* + : ( '}}' SpaceOrTab* LineBreak? {stripSpacesAroundTags && stripSingleLine}? + | '}}' WhitespaceChar* {stripSpacesAroundTags && !stripSingleLine}? | '-}}' WhitespaceChar* | '}}' ) -> popMode ; TagEnd - : ( {stripSpacesAroundTags && stripSingleLine}? '%}' SpaceOrTab* LineBreak? - | {stripSpacesAroundTags && !stripSingleLine}? '%}' WhitespaceChar* + : ( '%}' SpaceOrTab* LineBreak? {stripSpacesAroundTags && stripSingleLine}? + | '%}' WhitespaceChar* {stripSpacesAroundTags && !stripSingleLine}? | '-%}' WhitespaceChar* | '%}' ) -> popMode