Rework tracing arguments to --keep-traces & --trace-level

This allows for a more fine-grained control over how the traces are showed. Now users can instrument the compiler to preserve only their user-defined traces, or the only the compiler, or all, or none. We also want to add another trace level on top of that: 'compact' to only show line numbers; which will work for both user-defined and/or compiler-generated traces.
This commit is contained in:
KtorZ
2024-01-17 17:23:34 +01:00
parent 86146ae7f4
commit d27ea98a8f
12 changed files with 145 additions and 73 deletions

View File

@@ -1,5 +1,5 @@
use crate::{
ast::{Definition, ModuleKind, Tracing, TypedModule, UntypedModule},
ast::{Definition, ModuleKind, TraceLevel, Tracing, TypedModule, UntypedModule},
builtins,
expr::TypedExpr,
parser,
@@ -31,7 +31,7 @@ fn check_module(
kind,
"test/project",
&module_types,
Tracing::KeepTraces,
Tracing::All(TraceLevel::Verbose),
&mut warnings,
);