Appearance
| 1 | namespace Syntax.Trees.Expressions is | |
| 2 | ||
| 3 | use Source | |
| 4 | ||
| 5 | // `_(args)` - construct the type the context expects. The type is | |
| 6 | // never written, so it comes entirely from the constraint pushed in | |
| 7 | // by the parent: the left-hand side of an assignment, a typed | |
| 8 | // initializer, or a call argument whose formal type is known. | |
| 9 | class CONSTRUCT: Expression is | |
| 10 | arguments: LIST | |
| 11 | ||
| 12 | init(location: LOCATION, arguments: LIST) is | |
| 13 | super.init(location) | |
| 14 | ||
| 15 | self.arguments = arguments | |
| 16 | si | |
| 17 | ||
| 18 | set_expected_type(expected_type: Semantic.Types.Type?, error_message: string?) is | |
| 19 | compile_expressions_state.set_expected_type(expected_type, error_message) | |
| 20 | si | |
| 21 | ||
| 22 | accept(visitor: Visitor) is | |
| 23 | visitor.visit(self) | |
| 24 | si | |
| 25 | ||
| 26 | walk(visitor: Visitor) is | |
| 27 | if !visitor.pre(self) then | |
| 28 | arguments.walk(visitor) | |
| 29 | fi | |
| 30 | ||
| 31 | accept(visitor) | |
| 32 | si | |
| 33 | si | |
| 34 | si |