-
Notifications
You must be signed in to change notification settings - Fork 740
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite large portion of Liquid lexer (#1327)
This commit is an extensive updating of the Liquid lexer. It does the following: - supports negative numbers; - supports `tablerow` block; - supports reversed flag in for-loops; - supports whitespace control dashes in tags; - supports hyphens in variable names; - supports `first`, `last` and `size` dot notation; - supports `echo` and `render` tags; - supports objects within an `include` tag; - tokenises `empty` and `blank` aliases as `Name::Builtin`; - tokenises `capture`'s argument as a `Name::Variable`; - tokenises `include`'s filename argument as `Name::Other`; - tokenises `with`, `for` and `in` as `Name::Tag`; - tokenises `nil` as `Keyword::Constant`; - tokenises `increment` and `decrement` as `Name::Tag`; - tokenises for-loop objects as `Name::Builtin`; - stops treating `not` and `!` as operators; and - requires a filter name to follow a pipe. In addition, this commit refactors the lexer and removes several redundant lines and states.
- Loading branch information
1 parent
c227b37
commit e3f26ee
Showing
3 changed files
with
108 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.