(
path: &Path,
mode: compiler::Mode,
opts: compiler::CompileOpts,
expand_code_objects: bool,
)
| 73 | } |
| 74 | |
| 75 | fn display_script( |
| 76 | path: &Path, |
| 77 | mode: compiler::Mode, |
| 78 | opts: compiler::CompileOpts, |
| 79 | expand_code_objects: bool, |
| 80 | ) -> Result<(), Box<dyn Error>> { |
| 81 | let source = fs::read_to_string(path)?; |
| 82 | let code = compiler::compile(&source, mode, &path.to_string_lossy(), opts)?; |
| 83 | println!("{}:", path.display()); |
| 84 | if expand_code_objects { |
| 85 | println!("{}", code.display_expand_code_objects()); |
| 86 | } else { |
| 87 | println!("{code}"); |
| 88 | } |
| 89 | Ok(()) |
| 90 | } |
no test coverage detected