Commit Graph
56 Commits
Author SHA1 Message Date
Charles-P. Clermont a4e82eb5c1 Annotate Parser with grammar rules 2026-01-27 10:07:35 -05:00
Charles-P. Clermont 10c0de74b5 Add support for parenthesized expressions 2026-01-27 10:07:35 -05:00
Charles-P. Clermont f9b5313020 Prepare logical for grouping 2026-01-27 10:07:35 -05:00
Charles-P. Clermont 429711fd82 Add support for logical expressions 2026-01-26 16:53:38 -05:00
Charles-P. Clermont 0b890904f0 Make Parser.expression parse equality expressions 2026-01-26 16:52:31 -05:00
Charles-P. Clermont b161dae495 Make Parser.expression parse comparisons 2026-01-26 16:52:31 -05:00
Charles-P. Clermont dff829ec72 Extract Parser#range_lookup out of Expression.parse 2026-01-26 16:52:17 -05:00
Charles-P. Clermont 8b04c52ab2 Extract Parser#variable_lookup out of Expression.parse 2026-01-26 16:52:17 -05:00
Charles-P. Clermont e1e0129983 Extract Parser#number parse out of Expression.parse 2026-01-26 16:52:17 -05:00
Charles-P. Clermont 2a86852eb3 Extract Parser#string out of Expression.parse 2026-01-26 16:52:17 -05:00
Charles-P. Clermont c9ae128354 Rename Parser#expression_node -> Parser#expression 2026-01-26 16:52:17 -05:00
Charles-P. Clermont 6cfcd6cac0 Rename Parser#argument -> argument_string 2026-01-26 16:52:17 -05:00
Charles-P. Clermont 6b78291449 Rename Parser#expression -> Parser#expression_string 2026-01-26 16:52:17 -05:00
Charles-P. Clermont 7d0bdd166d Move parse_expression to Parser.unsafe_parse_expression
- Add Parser#string
- Add Parser#unsafe_parse_expression
- Add private Parser#parse_expression
- Remove ParseContext.parse_expression
- Remove Tag.parse_expression
- Condition.parse_expression now takes a parser as argument
2026-01-26 16:52:17 -05:00
Charles-P. Clermont cf3d845315 Move safe_parse_expression into Parser.expression_node
- Make `Parser` accept the expression cache
- Remove `safe_parse_expression` from `ParseContext`
- Replace all usage of `safe_parse_expression` with `parser.expression_node`
2026-01-26 16:52:17 -05:00
Julia BoutinandGuilherme Carreiro 98fbd985d8 Remove unneeded read method 2025-10-30 12:00:44 +01:00
Julia BoutinandGuilherme Carreiro d4d2237b90 Support prop spreading 2025-10-30 12:00:44 +01:00
Guilherme CarreiroandGuilherme Carreiro e413104e78 Remove ExpressionParser in favor of ParseContext#safe_parse 2025-10-27 16:33:31 +01:00
Guilherme CarreiroandGuilherme Carreiro 1bff382ebc Add ExpressionParser and ExpressionConsumer 2025-10-27 16:33:31 +01:00
Michael Go 04bd9dbe90 refactor Lexer to only take StringScanner 2025-01-07 14:32:46 -04:00
Michael Go 253ec81b56 don't add a breaking change to Parser constructor 2025-01-07 14:32:46 -04:00
Michael Go 7c592c1c00 store StringScanner in ParseContext and reuse it through parsing 2025-01-07 14:32:45 -04:00
Michael Go 002e4caea7 refactor Lexer to be static class function 2025-01-07 14:32:07 -04:00
Ian Ker-SeymerandGitHub b3553787c8 Speed up the lexer for Ruby 3.4+ (#1832)
* Speed up lexing

* Bump msrv to 3.0 (from 2.7)

* Normalize test for ruby-head compat

* Fix bug when parsing negative numbers
2024-10-23 14:15:33 -04:00
Dylan Thacker-Smith 46fd63da5f Fix strict parsing of find variable with a name expression 2020-10-19 12:17:25 -04:00
Dylan Thacker-Smith 420a1c79e1 Refactor variable lookup strict parsing to reduce coupling on dot lookup 2020-10-19 12:10:32 -04:00
Dylan Thacker-Smith 6d39050e1e Use a case statement in Liquid::Parser#expression 2020-10-19 12:10:11 -04:00
Alessandro Diogo BrückheimerandMike Angell e83b1e4159 Add ForceEqualSignAlignment to .rubocop.yml (#1190)
* Add ForceEqualSignAlignment to .rubocop.yml

* Revert ForceEqualSignAlignment cop

* Update method alignment

* Undo addition of whitespace to improve readability

* Fix missing alignment
2019-10-21 21:18:48 +10:00
0d26f05bb8 Enabled frozen string literals (#1154)
* Enabled frozen string literals

* Update rubocop config

* Prefer string interpolation in simple cases

Co-Authored-By: Dylan Thacker-Smith <[email protected]>
2019-09-18 13:19:45 +10:00
Mike Angell 799da202df Apply simple rubocop fixes 2019-08-31 21:58:33 +10:00
Ashwin MaroliandGitHub 2c42447659 Rename constant to SINGLE_TOKEN_EXPRESSION_TYPES 2019-05-17 23:30:24 +05:30
Ashwin Maroli 9ef6f9b642 Freeze mutable object assigned to constant 2019-04-29 23:50:49 +05:30
Ashwin Maroli 4684478e94 Use a private constant to stash token-types 2019-04-29 23:45:45 +05:30
Florian Weingarten 4d6dec9b5a Fix chained access to multi-dimensional hash 2015-07-17 10:10:00 -04:00
Justin Li a07e382617 Use a single token for identifiers 2014-10-29 11:28:41 -04:00
Justin Li de16db9b72 Don't allow - to end a variable name 2014-10-17 13:38:07 -04:00
Justin Li b4ea483c4e Separate ? and - into special tokens 2014-10-17 13:30:54 -04:00
Florian Weingarten 0a7de51e2b Revert some freezes on non-literals 2014-01-27 14:56:07 -05:00
Florian Weingarten 43ac8d560b Freeze all the things 2014-01-07 12:35:16 -05:00
Tristan Hume 7c5b3e0c3b Fix bad range parsing. 2013-09-04 18:13:31 -04:00
Tristan Hume 86ba2f4174 Fix error message 1.8 compatibility 2013-08-22 13:23:44 -04:00
Tristan Hume 324d26d405 Consistent lack of periods in syntax errors. 2013-08-19 15:20:39 -04:00
Tristan Hume 6cde98319f More little fixes and changed default benchmark 2013-08-02 15:21:15 -04:00
Tristan Hume 15b53b77d6 Make stuff nicer 2013-08-02 15:17:17 -04:00
Tristan Hume 8ca00982b6 Fixed ranges and added for loop parser 2013-07-29 14:11:47 -04:00
Tristan Hume 525e1ff195 Add range support 2013-07-29 13:25:48 -04:00
Tristan Hume bc76c0daaf Collapse float and int into 'number' 2013-07-29 11:04:46 -04:00
Harry Brundage bacacf2fd0 Remove the Token class from the lexer in favour of less smart but faster arrays 2013-07-26 15:14:01 -04:00
Tristan Hume 1b43bf5686 Add parser tests 2013-07-26 13:09:36 -04:00
Tristan Hume 673826630c Unfinished if statement parser. 2013-07-26 09:32:08 -04:00