Appearance
| 1 | namespace Syntax.Trees.Expressions is | |
| 2 | use Source; | |
| 3 | ||
| 4 | use Logging; | |
| 5 | ||
| 6 | class LET_IN: Expression, ScopeCarrier is | |
| 7 | scope: Semantic.Scope? public; | |
| 8 | ||
| 9 | variables: Variables.LIST; | |
| 10 | expression: Expression; | |
| 11 | want_dispose: bool; | |
| 12 | ||
| 13 | description: string => "let in expression"; | |
| 14 | ||
| 15 | expects_semicolon: bool => true; | |
| 16 | must_be_consumed: bool => true; | |
| 17 | ||
| 18 | is_tuple_literal: bool => | |
| 19 | if expression.is_tuple_literal then | |
| 20 | true | |
| 21 | else | |
| 22 | false | |
| 23 | fi; | |
| 24 | ||
| 25 | init(location: LOCATION, want_dispose: bool, variables: Variables.LIST, expression: Expression) is | |
| 26 | super.init(location); | |
| 27 | ||
| 28 | ||
| 29 | self.variables = variables; | |
| 30 | self.expression = expression; | |
| 31 | self.want_dispose = want_dispose; | |
| 32 | ||
| 33 | if want_dispose then | |
| 34 | variables.mark_want_dispose(); | |
| 35 | fi | |
| 36 | si | |
| 37 | ||
| 38 | set_expected_type(expected_type: Semantic.Types.Type?, error_message: string?) is | |
| 39 | expression.set_expected_type(expected_type, error_message); | |
| 40 | si | |
| 41 | ||
| 42 | clear_expected_type() is | |
| 43 | expression.clear_expected_type(); | |
| 44 | si | |
| 45 | ||
| 46 | accept(visitor: Visitor) is | |
| 47 | visitor.visit(self); | |
| 48 | si | |
| 49 | ||
| 50 | walk(visitor: Visitor) is | |
| 51 | if !visitor.pre(self) then | |
| 52 | variables.walk(visitor); | |
| 53 | expression.walk(visitor); | |
| 54 | fi | |
| 55 | ||
| 56 | accept(visitor); | |
| 57 | si | |
| 58 | si | |
| 59 | si |