mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-16 17:30:43 -07:00
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
This commit is contained in:
+14
-2
@@ -72,9 +72,9 @@ module Liquid
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def expression_node
|
||||
expr = expression
|
||||
Expression.parse(expr, @ss, @cache)
|
||||
parse_expression(expression)
|
||||
end
|
||||
|
||||
def argument
|
||||
@@ -104,5 +104,17 @@ module Liquid
|
||||
end
|
||||
str
|
||||
end
|
||||
|
||||
# Assumes safe input. For cases where you need the string.
|
||||
# Don't use this unless you're sure about what you're doing.
|
||||
def unsafe_parse_expression(markup)
|
||||
parse_expression(markup)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def parse_expression(markup)
|
||||
Expression.parse(markup, @ss, @cache)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user