From fc432e258f010b271ac3140211171336462d74f3 Mon Sep 17 00:00:00 2001 From: Michael Go Date: Thu, 14 Nov 2024 17:50:46 -0400 Subject: [PATCH] don't cache literals for Expression parser --- lib/liquid/expression.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/liquid/expression.rb b/lib/liquid/expression.rb index d860e20b9..c9a50fd15 100644 --- a/lib/liquid/expression.rb +++ b/lib/liquid/expression.rb @@ -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) @@ -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