mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-18 18:30:40 -07:00
Implement line numbers without the Liquid::Token class.
This commit is contained in:
@@ -1,16 +1,15 @@
|
||||
module Liquid
|
||||
module ParserSwitching
|
||||
def parse_with_selected_parser(markup)
|
||||
case @options[:error_mode] || Template.error_mode
|
||||
case @options.error_mode
|
||||
when :strict then strict_parse_with_error_context(markup)
|
||||
when :lax then lax_parse(markup)
|
||||
when :warn
|
||||
begin
|
||||
return strict_parse_with_error_context(markup)
|
||||
rescue SyntaxError => e
|
||||
e.set_line_number_from_token(markup)
|
||||
@warnings ||= []
|
||||
@warnings << e
|
||||
e.line_number = line_number
|
||||
@options.warnings << e
|
||||
return lax_parse(markup)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user