Appearance
| 1 | namespace Syntax.Trees.Statements is | |
| 2 | use Source | |
| 3 | ||
| 4 | // `break` parses uniformly as `break <expr>`; a missing expression is | |
| 5 | // the bare form. When the expression is a bare identifier resolving to | |
| 6 | // a loop-label symbol, compile-expressions stamps `resolved_target` | |
| 7 | // with the labelled loop statement and the name is taken as a label | |
| 8 | // rather than a value; any other resolution breaks with the value. | |
| 9 | class BREAK(location: LOCATION, expression: Expressions.Expression?): Statement is | |
| 10 | expects_semicolon: bool => true | |
| 11 | ||
| 12 | resolved_target: Statement? public => jump_state.resolved_target, = value is jump_state.resolved_target = value si | |
| 13 | ||
| 14 | jump_state: Syntax.Process.JUMP_STATE field | |
| 15 | ||
| 16 | super(location) | |
| 17 | ||
| 18 | clear() is | |
| 19 | super.clear() | |
| 20 | ||
| 21 | jump_state.clear() | |
| 22 | si | |
| 23 | ||
| 24 | clear_outputs() is | |
| 25 | super.clear_outputs() | |
| 26 | ||
| 27 | jump_state.clear() | |
| 28 | si | |
| 29 | ||
| 30 | accept(visitor: Visitor) is | |
| 31 | visitor.visit(self) | |
| 32 | si | |
| 33 | ||
| 34 | walk(visitor: Visitor) is | |
| 35 | if !visitor.pre(self) then | |
| 36 | if let self.expression? then | |
| 37 | expression.walk(visitor) | |
| 38 | fi | |
| 39 | fi | |
| 40 | accept(visitor) | |
| 41 | si | |
| 42 | si | |
| 43 | si |