Skip to content
← Back

src/syntax/trees/statements/statement.ghul

1
namespace Syntax.Trees.Statements is
2
use Source
3
use IR.Values.Value
4
5
use Logging
6
7
class Statement(location: LOCATION): Trees.Node, Trees.DisposalHost abstract is
8
// Compile-expressions output; contents owned by that pass.
9
compile_expressions_state: Syntax.Process.STATEMENT_STATE field
10
11
value: Value? => compile_expressions_state.value
12
want_value: bool => compile_expressions_state.want_value
13
void_tolerated: bool => compile_expressions_state.void_tolerated
14
let_in_disposals: Collections.List[Semantic.Symbols.Variable]? => compile_expressions_state.let_in_disposals
15
16
expects_semicolon: bool => false
17
provides_value: bool => false
18
is_tuple_literal: bool => false
19
20
super(location)
21
22
set_expected_type(expected_type: Semantic.Types.Type?, error_message: string?) is
23
si
24
25
clear_expected_type() is
26
si
27
28
add_let_in_disposal(v: Semantic.Symbols.Variable) is
29
compile_expressions_state.add_let_in_disposal(v)
30
si
31
32
clear() is
33
super.clear()
34
compile_expressions_state.clear()
35
si
36
37
clear_outputs() is
38
compile_expressions_state.clear_outputs()
39
si
40
41
si
42
si