diff --git a/lib/liquid/parser.rb b/lib/liquid/parser.rb index 645dfa3a..0d0d0d01 100644 --- a/lib/liquid/parser.rb +++ b/lib/liquid/parser.rb @@ -83,6 +83,9 @@ module Liquid end def variable_lookups + # Fast path: no lookups at all (most common case for simple identifiers) + return "" unless look(:dot) || look(:open_square) + str = +"" loop do if look(:open_square)