From 25b3393dc477547c2d6b1e3515c8340fb0db1a13 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Tue, 3 Mar 2026 00:24:11 +0100 Subject: Support debug viewing the AST --- oryxc/src/compiler.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'oryxc/src') 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)); -- cgit v1.2.3