Skip to content

Commit

Permalink
don't cache literals for Expression parser
Browse files Browse the repository at this point in the history
  • Loading branch information
ggmichaelgo committed Nov 14, 2024
1 parent c0e45c1 commit fc432e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/liquid/expression.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ def parse(markup)
if (markup.start_with?('"') && markup.end_with?('"')) ||
(markup.start_with?("'") && markup.end_with?("'"))
return markup[1..-2]
elsif LITERALS.key?(markup)
return LITERALS[markup]
end

return CACHE[markup] if CACHE.key?(markup)
Expand All @@ -96,8 +98,6 @@ def inner_parse(markup)
return RangeLookup.parse(Regexp.last_match(1), Regexp.last_match(2))
end

return LITERALS[markup] if LITERALS.key?(markup)

if (num = parse_number(markup))
num
else
Expand Down

0 comments on commit fc432e2

Please sign in to comment.