diff options
| author | Thomas Voss <mail@thomasvoss.com> | 2026-03-03 00:24:11 +0100 |
|---|---|---|
| committer | Thomas Voss <mail@thomasvoss.com> | 2026-03-03 00:24:11 +0100 |
| commit | 25b3393dc477547c2d6b1e3515c8340fb0db1a13 (patch) | |
| tree | 8e1ad89d1c848060f656186b6303cc0441b6a5e6 /oryxc | |
| parent | 10d5ec574fbade12b8481d195daa4b8e900c7fe6 (diff) | |
Support debug viewing the AST
Diffstat (limited to 'oryxc')
| -rw-r--r-- | oryxc/src/compiler.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/oryxc/src/compiler.rs b/oryxc/src/compiler.rs index 1e539ce..bca1ba6 100644 --- a/oryxc/src/compiler.rs +++ b/oryxc/src/compiler.rs @@ -171,6 +171,14 @@ fn worker_loop( } let (ast, _extra_data) = parser::parse(name, &tokens); + + if state.flags.debug_parser { + let mut handle = io::stderr().lock(); + for n in ast.iter() { + let _ = write!(handle, "{n:?}\n"); + } + } + let mut fdata = state.files.get_mut(&file).unwrap(); fdata.tokens = Arc::from(MaybeUninit::new(tokens)); fdata.ast = Arc::from(MaybeUninit::new(ast)); |