mirror of
https://github.com/kemko/liquid.git
synced 2026-01-01 15:55:40 +03:00
Simplifications from review
This commit is contained in:
@@ -26,11 +26,7 @@ module Liquid
|
||||
|
||||
private def parse_for_liquid_tag(tokenizer, parse_context)
|
||||
while token = tokenizer.shift
|
||||
case
|
||||
when token.empty? || token =~ WhitespaceOrNothing
|
||||
# pass, but assign line_number below, since it could change even when
|
||||
# the token is empty
|
||||
else
|
||||
unless token.empty? || token =~ WhitespaceOrNothing
|
||||
unless token =~ LiquidTagToken
|
||||
# line isn't empty but didn't match tag syntax, yield and let the
|
||||
# caller raise a syntax error
|
||||
@@ -73,7 +69,7 @@ module Liquid
|
||||
|
||||
if tag_name == 'liquid'.freeze
|
||||
liquid_tag_tokenizer = Tokenizer.new(markup, line_number: parse_context.line_number, for_liquid_tag: true)
|
||||
next parse(liquid_tag_tokenizer, parse_context, &block)
|
||||
next parse_for_liquid_tag(liquid_tag_tokenizer, parse_context, &block)
|
||||
end
|
||||
|
||||
unless tag = registered_tags[tag_name]
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
syntax:
|
||||
tag_unexpected_args: "Syntax Error in '%{tag}' - Valid syntax: %{tag}"
|
||||
assign: "Syntax Error in 'assign' - Valid syntax: assign [var] = [source]"
|
||||
local: "Syntax Error in 'local' - Valid syntax: local [var] = [source]"
|
||||
capture: "Syntax Error in 'capture' - Valid syntax: capture [var]"
|
||||
case: "Syntax Error in 'case' - Valid syntax: case [condition]"
|
||||
case_invalid_when: "Syntax Error in tag 'case' - Valid when condition: {% when [condition] [or condition2...] %}"
|
||||
|
||||
Reference in New Issue
Block a user