blob: a29623f5675b8e5a23a6f732ba3160b65113310d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
class Puppet::Parser::AST
# A separate ElseIf statement; can function as an 'else' if there's no
# test.
class Else < AST::Branch
attr_accessor :statements
def each
yield @statements
end
# Evaluate the actual statements; this only gets called if
# our test was true matched.
def evaluate(hash)
scope = hash[:scope]
return @statements.safeevaluate(:scope => scope)
end
def tree(indent = 0)
rettree = [
((@@indline * indent) + self.typewrap(self.pin)),
@statements.tree(indent + 1)
]
return rettree.flatten.join("\n")
end
end
end
|