From 2f0b25784218efd31a40ac723c96567b3d97a7d7 Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 28 Mar 2023 22:17:34 +0200 Subject: [PATCH] Verbose option for pil compiler. --- src/bin/compiler.rs | 6 ++++++ src/compiler.rs | 3 ++- tests/pil.rs | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/bin/compiler.rs b/src/bin/compiler.rs index 421a3f26f..83e40d12c 100644 --- a/src/bin/compiler.rs +++ b/src/bin/compiler.rs @@ -107,6 +107,10 @@ enum Commands { #[arg(short, long)] #[arg(default_value_t = String::from("."))] output_directory: String, + /// Verbose output (provides a full execution trace). + #[arg(short, long)] + #[arg(default_value_t = false)] + verbose: bool, }, } @@ -178,11 +182,13 @@ fn main() { Commands::Compile { file, output_directory, + verbose, } => { powdr::compiler::compile_pil( Path::new(&file), Path::new(&output_directory), no_callback(), + verbose, ); } } diff --git a/src/compiler.rs b/src/compiler.rs index 2c7fddf93..c34748475 100644 --- a/src/compiler.rs +++ b/src/compiler.rs @@ -21,13 +21,14 @@ pub fn compile_pil( pil_file: &Path, output_dir: &Path, query_callback: Option Option>, + verbose: bool, ) -> bool { compile( &analyzer::analyze(pil_file), pil_file.file_name().unwrap().to_str().unwrap(), output_dir, query_callback, - false, + verbose, ) } diff --git a/tests/pil.rs b/tests/pil.rs index 4be196792..ee5edc60e 100644 --- a/tests/pil.rs +++ b/tests/pil.rs @@ -16,7 +16,8 @@ pub fn verify_pil(file_name: &str, query_callback: Option Option