Appearance
| 1 | namespace Syntax.Trees.Statements is | |
| 2 | use Source; | |
| 3 | ||
| 4 | use Logging; | |
| 5 | ||
| 6 | class EXPRESSION(location: LOCATION, expression: Expressions.Expression): Statement is | |
| 7 | provides_value: bool => true; | |
| 8 | is_tuple_literal: bool => | |
| 9 | if expression.is_tuple_literal then | |
| 10 | true | |
| 11 | else | |
| 12 | false | |
| 13 | fi; | |
| 14 | ||
| 15 | set_expected_type(expected_type: Semantic.Types.Type?, error_message: string?) => | |
| 16 | expression.set_expected_type(expected_type, error_message); | |
| 17 | ||
| 18 | // TODO may not be wanted if it's a statement expression that | |
| 19 | // ends with a keyword | |
| 20 | expects_semicolon: bool => true; | |
| 21 | ||
| 22 | super(location); | |
| 23 | ||
| 24 | accept(visitor: Visitor) is | |
| 25 | visitor.visit(self); | |
| 26 | si | |
| 27 | ||
| 28 | walk(visitor: Visitor) is | |
| 29 | if !visitor.pre(self) then | |
| 30 | expression.walk(visitor); | |
| 31 | fi | |
| 32 | ||
| 33 | accept(visitor); | |
| 34 | si | |
| 35 | si | |
| 36 | si |