Add Liquid::ParseContext#parse_expression for liquid-c node disabling (#1333)

We would like to be able to disable liquid-c VM rendering at runtime,
but right now expression parsing is done using Expression.parse, which
isn't aware of the parse context.  That prevents us from conditionally
compiling to VM code based on a parse option.
This commit is contained in:
Dylan Thacker-Smith
2020-10-27 11:00:04 -04:00
committed by GitHub
parent 0e52706a5b
commit 10ea6144e0
10 changed files with 29 additions and 19 deletions
+2 -2
View File
@@ -45,8 +45,8 @@ module Liquid
@@operators
end
def self.parse_expression(markup)
@@method_literals[markup] || Expression.parse(markup)
def self.parse_expression(parse_context, markup)
@@method_literals[markup] || parse_context.parse_expression(markup)
end
attr_reader :attachment, :child_condition