mirror of
https://github.com/Shopify/liquid.git
synced 2026-10-03 09:05:13 -07:00
micro optimization
This commit is contained in:
@@ -63,6 +63,18 @@ module Liquid
|
|||||||
end
|
end
|
||||||
|
|
||||||
def next_token(ss)
|
def next_token(ss)
|
||||||
|
if ss.pos == 0
|
||||||
|
if ss.string.start_with?("{{")
|
||||||
|
ss.pos = 2
|
||||||
|
return next_variable_token(ss)
|
||||||
|
elsif ss.string.start_with?("{%")
|
||||||
|
ss.pos = 2
|
||||||
|
return next_tag_token(ss)
|
||||||
|
else
|
||||||
|
return next_text_token(ss)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# possible states: :text, :tag, :variable
|
# possible states: :text, :tag, :variable
|
||||||
byte_a = ss.scan_byte
|
byte_a = ss.scan_byte
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user