Skip to content

Commit

Permalink
Include correct tokens in not_out_end and other_than_tag_end
Browse files Browse the repository at this point in the history
This reverts commit fe19822.
  • Loading branch information
bkiers committed Oct 13, 2024
1 parent fe19822 commit 2312fa4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/antlr4/liquid/parser/v4/LiquidLexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ fragment Letter : [a-zA-Z];
fragment Digit : [0-9];

// Note that when adding tokens to this `IN_TAG` mode, be sure to include them in the parser
// rule `other_than_tag_end` as well!
// rules `not_out_end` and/or `other_tag_parameters` as well!
mode IN_TAG;

OutStart2 : '{{' -> pushMode(IN_TAG);
Expand Down
7 changes: 5 additions & 2 deletions src/main/antlr4/liquid/parser/v4/LiquidParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,10 @@ output
// `( ~OutEnd )+`, it ran in about 8000-8500 ms on average. With the individual tokens specified in the `IN_TAG` mode,
// the average runtime was around 3000-3200 ms.
not_out_end
: other_than_tag_end
: ( TagEnd | OutStart2 | Str | DotDot | Dot | NEq | Eq | EqSign | GtEq | Gt | LtEq | Lt | Minus | Pipe
| Col | Comma | OPar | CPar | OBr | CBr | QMark | PathSep | DoubleNum | LongNum | Contains | In | And
| Or | True | False | Nil | With | Offset | Continue | Reversed | Empty | Blank | IdChain | Id
)+
;

filter
Expand Down Expand Up @@ -338,7 +341,7 @@ other_tag_parameters
;

other_than_tag_end
: ( OutStart2 | TagEnd | Str | DotDot | Dot | NEq | Eq | EqSign | GtEq | Gt | LtEq | Lt | Minus | Pipe
: ( OutEnd | OutStart2 | Str | DotDot | Dot | NEq | Eq | EqSign | GtEq | Gt | LtEq | Lt | Minus | Pipe
| Col | Comma | OPar | CPar | OBr | CBr | QMark | PathSep | DoubleNum | LongNum | Contains | In | And
| Or | True | False | Nil | With | Offset | Continue | Reversed | Empty | Blank | IdChain | Id
)+
Expand Down

0 comments on commit 2312fa4

Please sign in to comment.