Appearance
| 1 | namespace IR.Values is | |
| 2 | use Semantic.Types.Type | |
| 3 | ||
| 4 | class ENTER_FILE: Value is | |
| 5 | path: string | |
| 6 | ||
| 7 | init( | |
| 8 | path: string | |
| 9 | ) is | |
| 10 | super.init() | |
| 11 | ||
| 12 | self.path = path | |
| 13 | si | |
| 14 | ||
| 15 | gen(context: IR.CONTEXT) is | |
| 16 | // Records the offset range the marked statement emits. The | |
| 17 | // range leaves the method as a custom attribute the IL test | |
| 18 | // runner reads. Outside a body there is no range to record: | |
| 19 | // a pragma on a declaration marks nothing this can measure. | |
| 20 | if let body = context.current_srm_body_emitter then | |
| 21 | body.begin_il_output(path, context.next_il_output_sequence()) | |
| 22 | fi | |
| 23 | si | |
| 24 | ||
| 25 | to_string() -> string => | |
| 26 | "enter-file:({path})" | |
| 27 | si | |
| 28 | ||
| 29 | class LEAVE_FILE: Value is | |
| 30 | path: string | |
| 31 | ||
| 32 | init( | |
| 33 | path: string | |
| 34 | ) is | |
| 35 | super.init() | |
| 36 | ||
| 37 | self.path = path | |
| 38 | si | |
| 39 | ||
| 40 | gen(context: IR.CONTEXT) is | |
| 41 | if let body = context.current_srm_body_emitter then | |
| 42 | body.end_il_output() | |
| 43 | fi | |
| 44 | si | |
| 45 | ||
| 46 | to_string() -> string => | |
| 47 | "exit-file" | |
| 48 | si | |
| 49 | si |