Skip to content

Commit

Permalink
Disable comments by default
Browse files Browse the repository at this point in the history
adds option to enable them
  • Loading branch information
franziskuskiefer committed Oct 11, 2024
1 parent 1fff1c5 commit 809fdf7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions bin/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Supported options:|}
( "--header",
Arg.Set_string Krml.Options.header,
" path to a header file to be prepended to the generated C" );
"--comments", Arg.Set O.comments, " keep inline comments";
"--config", Arg.Set_string O.config, " YAML configuration file";
"-funroll-loops", Arg.Set_int funroll_loops, " unrool loops up to N";
]
Expand Down
2 changes: 1 addition & 1 deletion lib/AstOfLlbc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1563,7 +1563,7 @@ let rec expression_of_raw_statement (env : env) (ret_var : C.var_id) (s : C.raw_

and expression_of_statement (env: env) (ret_var: C.var_id) (s: C.statement): K.expr =
{ (expression_of_raw_statement env ret_var s.content) with
meta = List.map (fun x -> K.CommentBefore x) s.comments_before }
meta = if !Options.comments then List.map (fun x -> K.CommentBefore x) s.comments_before else [] }

(** Top-level declarations: orchestration *)

Expand Down
1 change: 1 addition & 0 deletions lib/Options.ml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
let log_level = ref ""
let config = ref ""
let comments = ref false

0 comments on commit 809fdf7

Please sign in to comment.