Skip to content
← Back

src/compiler/source_file.ghul

1
namespace Compiler is
2
use IO.Std
3
4
// The effective compile-depth flags (want_compile_up_to_expressions /
5
// want_compile_expressions) are seeded at parse time from the command-
6
// line request held in GLOBAL_BUILD_FLAGS; the analyser overrides them
7
// per file as the active document changes.
8
class SOURCE_FILE(
9
want_compile_up_to_expressions: bool public,
10
want_compile_expressions: bool public,
11
file_name: string,
12
definition: Syntax.Trees.Definitions.Definition
13
) is
14
// Most recent pass run on this file
15
compiled_through: Pass? public
16
17
// Comments and blank-line markers collected by the tokenizer
18
trivia: Collections.Iterable[Lexical.TRIVIA]? public
19
20
// Signature built from the file's declaration syntax tree nodes
21
interface_signature: string? public
22
23
// Full source text this file's tree was parsed from. Retained by
24
// analysis mode (null in batch builds and for internal library
25
// files): the incremental interface reconcile compares old and
26
// new body spans textually to decide whether a replaced member's
27
// derived facts survive the edit.
28
source_text: string? public
29
30
// Source locations of contextual-keyword modifiers (`init`, `open`)
31
// captured post-parse before `rewrite-syntax-trees` consumes them.
32
// Read by the analysis-mode semantic-tokens handler to overlay
33
// `keyword` tokens the TextMate grammar can't safely classify.
34
contextual_modifier_locations: Collections.Iterable[Source.LOCATION]? public
35
36
to_string() -> string =>
37
file_name
38
si
39
si