28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
# File 'lib/walrus/grammar/echo_directive.rb', line 28
def compile options = {}
if @expression.respond_to? :each
expression = @expression
else
expression = [@expression]
end
compiled = ''
first = true
expression.each do |expr|
if first
compiled <<
"accumulate(instance_eval { %s }) # Echo directive\n" %
expr.compile
first = false
else
compiled <<
"accumulate(instance_eval { %s }) # Echo directive (continued)\n" %
expr.compile
end
end
compiled
end
|