mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-15 08:50:45 -07:00
clean up filter parsing: Lexer fallback for args, no-arg fast scan stays
This commit is contained in:
@@ -202,12 +202,10 @@ module Liquid
|
||||
# Skip whitespace
|
||||
filter_pos += 1 while filter_pos < len && markup.getbyte(filter_pos) == 32
|
||||
|
||||
# Check for colon (has arguments) — use Lexer for the remaining filter chain
|
||||
# Has arguments — use Lexer-based parser for this and remaining filters
|
||||
if filter_pos < len && markup.getbyte(filter_pos) == 58 # ':'
|
||||
# Rewind to the '|' before this filter and use Lexer for the rest
|
||||
# We already have filters parsed so far as no-arg filters
|
||||
# Rewind to the '|' before this filter for the Lexer
|
||||
rest_start = fname_start
|
||||
# Go back to find the '|' before this filter name
|
||||
rest_start -= 1 while rest_start > pos && markup.getbyte(rest_start) != 124
|
||||
rest_markup = markup.byteslice(rest_start, len - rest_start)
|
||||
p = parse_context.new_parser(rest_markup)
|
||||
|
||||
Reference in New Issue
Block a user