mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-29 07:05:12 -07:00
move line number check
This commit is contained in:
@@ -106,7 +106,7 @@ module Liquid
|
|||||||
@options = options
|
@options = options
|
||||||
@profiling = options[:profile]
|
@profiling = options[:profile]
|
||||||
@profiling = options.delete(:profile)
|
@profiling = options.delete(:profile)
|
||||||
@line_numbers = options.delete(:line_numbers) || @profiling
|
@line_numbers = options.delete(:line_numbers)
|
||||||
@root = Document.parse(tokenize(source), DEFAULT_OPTIONS.merge(options))
|
@root = Document.parse(tokenize(source), DEFAULT_OPTIONS.merge(options))
|
||||||
@warnings = nil
|
@warnings = nil
|
||||||
self
|
self
|
||||||
@@ -226,7 +226,7 @@ module Liquid
|
|||||||
end
|
end
|
||||||
|
|
||||||
def calculate_line_numbers(raw_tokens)
|
def calculate_line_numbers(raw_tokens)
|
||||||
return raw_tokens unless @line_numbers
|
return raw_tokens unless @line_numbers || @profiling
|
||||||
|
|
||||||
current_line = 1
|
current_line = 1
|
||||||
raw_tokens.map do |token|
|
raw_tokens.map do |token|
|
||||||
|
|||||||
Reference in New Issue
Block a user