9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
# File 'lib/liquid/block.rb', line 9
def parse(tokens)
@nodelist ||= []
@nodelist.clear
while token = tokens.shift
case token
when IsTag
if token =~ FullToken
if block_delimiter == $1
end_tag
return
end
if tag = Template.tags[$1]
@nodelist << tag.new($1, $2, tokens)
else
unknown_tag($1, $2, tokens)
end
else
raise SyntaxError, "Tag '#{token}' was not properly terminated with regexp: #{TagEnd.inspect} "
end
when IsVariable
@nodelist << create_variable(token)
when ''
else
@nodelist << token
end
end
assert_missing_delimitation!
end
|