Skip to content
← Back

src/syntax/trees/statements/do.ghul

1
namespace Syntax.Trees.Statements is
2
use Source;
3
4
class DO: Statement, ScopeCarrier is
5
scope: Semantic.Scope? public;
6
7
condition: Expressions.Expression?;
8
binding: REFUTABLE_BINDING?;
9
body: Statements.LIST;
10
11
init(location: LOCATION, condition: Expressions.Expression?, body: Statements.LIST) is
12
init(location, condition, null, body);
13
si
14
15
init(
16
location: LOCATION,
17
condition: Expressions.Expression?,
18
binding: REFUTABLE_BINDING?,
19
body: Statements.LIST
20
) is
21
super.init(location);
22
23
self.condition = condition;
24
self.binding = binding;
25
self.body = body;
26
si
27
28
accept(visitor: Visitor) is
29
visitor.visit(self);
30
si
31
32
walk(visitor: Visitor) is
33
if !visitor.pre(self) then
34
if let self.binding? then
35
binding.walk(visitor);
36
fi
37
38
if let self.condition? then
39
condition.walk(visitor);
40
fi
41
42
body.walk(visitor);
43
fi
44
45
accept(visitor);
46
si
47
si
48
si