Span trace utilities and runner source hint
This commit is contained in:
@ -113,14 +113,12 @@ pub(crate) fn execute_file_with_backend(runner: &NyashRunner, filename: &str) {
|
||||
};
|
||||
let ast = match NyashParser::parse_from_string(&code) {
|
||||
Ok(ast) => ast,
|
||||
Err(e) => {
|
||||
crate::runner::modes::common_util::diag::print_parse_error_with_context(
|
||||
filename,
|
||||
&code,
|
||||
&e,
|
||||
);
|
||||
process::exit(1);
|
||||
}
|
||||
Err(e) => {
|
||||
crate::runner::modes::common_util::diag::print_parse_error_with_context(
|
||||
filename, &code, &e,
|
||||
);
|
||||
process::exit(1);
|
||||
}
|
||||
};
|
||||
// Optional macro expansion dump (no-op expansion for now)
|
||||
let ast2 = if crate::r#macro::enabled() {
|
||||
@ -144,14 +142,12 @@ pub(crate) fn execute_file_with_backend(runner: &NyashRunner, filename: &str) {
|
||||
};
|
||||
let ast = match NyashParser::parse_from_string(&code) {
|
||||
Ok(ast) => ast,
|
||||
Err(e) => {
|
||||
crate::runner::modes::common_util::diag::print_parse_error_with_context(
|
||||
filename,
|
||||
&code,
|
||||
&e,
|
||||
);
|
||||
process::exit(1);
|
||||
}
|
||||
Err(e) => {
|
||||
crate::runner::modes::common_util::diag::print_parse_error_with_context(
|
||||
filename, &code, &e,
|
||||
);
|
||||
process::exit(1);
|
||||
}
|
||||
};
|
||||
let expanded = if crate::r#macro::enabled() {
|
||||
let a = crate::r#macro::maybe_expand_and_dump(&ast, false);
|
||||
|
||||
Reference in New Issue
Block a user