mirror of
https://github.com/kemko/liquid.git
synced 2026-01-01 15:55:40 +03:00
Fix accessors
This commit is contained in:
@@ -10,7 +10,7 @@ module Liquid
|
||||
def parse(tokens)
|
||||
@blocks = []
|
||||
|
||||
if options =~ Syntax
|
||||
if markup =~ Syntax
|
||||
@left = Expression.parse(Regexp.last_match(1))
|
||||
else
|
||||
raise SyntaxError, options[:locale].t("errors.syntax.case")
|
||||
|
||||
@@ -25,7 +25,7 @@ module Liquid
|
||||
@variables = variables_from_string(Regexp.last_match(2))
|
||||
@name = Expression.parse(Regexp.last_match(1))
|
||||
when SimpleSyntax
|
||||
@variables = variables_from_string(@markup)
|
||||
@variables = variables_from_string(markup)
|
||||
@name = @variables.to_s
|
||||
else
|
||||
raise SyntaxError, options[:locale].t("errors.syntax.cycle")
|
||||
|
||||
@@ -15,11 +15,11 @@ module Liquid
|
||||
attr_reader :variable
|
||||
|
||||
def parse(_tokens)
|
||||
@variable = Variable.new(markup, options)
|
||||
@variable = Variable.new(markup, parse_context)
|
||||
end
|
||||
|
||||
def render(context)
|
||||
variable&.render_to_output_buffer(context, +'')
|
||||
@variable.render_to_output_buffer(context, +'')
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -52,9 +52,9 @@ module Liquid
|
||||
|
||||
def parse(tokens)
|
||||
@from = @limit = nil
|
||||
parse_with_selected_parser(markup)
|
||||
@for_block = BlockBody.new
|
||||
@else_block = nil
|
||||
parse_with_selected_parser(markup)
|
||||
return unless parse_body(@for_block, tokens)
|
||||
parse_body(@else_block, tokens)
|
||||
end
|
||||
|
||||
@@ -6,7 +6,7 @@ module Liquid
|
||||
FullTokenPossiblyInvalid = /\A(.*)#{TagStart}\s*(\w+)\s*(.*)?#{TagEnd}\z/om
|
||||
|
||||
def parse(tokens)
|
||||
ensure_valid_markup(tag_name, markup, options)
|
||||
ensure_valid_markup(tag_name, markup, parse_context)
|
||||
@body = +''
|
||||
while (token = tokens.shift)
|
||||
if token =~ FullTokenPossiblyInvalid
|
||||
@@ -16,7 +16,7 @@ module Liquid
|
||||
@body << token unless token.empty?
|
||||
end
|
||||
|
||||
raise SyntaxError, options.locale.t("errors.syntax.tag_never_closed", block_name: block_name)
|
||||
raise SyntaxError, parse_context.locale.t("errors.syntax.tag_never_closed", block_name: block_name)
|
||||
end
|
||||
|
||||
def render_to_output_buffer(_context, output)
|
||||
|
||||
Reference in New Issue
Block a user