mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-16 01:10:41 -07:00
20 lines
369 B
Ruby
20 lines
369 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Liquid
|
|
module ParserSwitching
|
|
def parse_with_selected_parser(markup)
|
|
parse_markup(markup)
|
|
rescue SyntaxError => e
|
|
e.line_number = line_number
|
|
e.markup_context = markup_context(markup)
|
|
raise e
|
|
end
|
|
|
|
private
|
|
|
|
def markup_context(markup)
|
|
"in \"#{markup.strip}\""
|
|
end
|
|
end
|
|
end
|