Skip to content

Commit ebb59ca

Browse files
authored
Merge pull request #3528 from mtzguido/krml_debug
Extraction: reduce krml output unless -d/--debug
2 parents 94daa5e + 7c6a76a commit ebb59ca

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/extraction/FStarC.Extraction.Krml.fst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,8 @@ let translate_type_decl' env ty: option decl =
13081308
Some (DTypeAbstractStruct name)
13091309
else if assumed then
13101310
let name = string_of_mlpath name in
1311-
Format.print1_warning "Not extracting type definition %s to KaRaMeL (assumed type)\n" name;
1311+
if not (Options.silent ()) then
1312+
Format.print1_warning "Not extracting type definition %s to KaRaMeL (assumed type)\n" name;
13121313
// JP: TODO: shall we be smarter here?
13131314
None
13141315
else
@@ -1358,7 +1359,8 @@ let translate_let' env flavor lb: option decl =
13581359
if List.length tvars = 0 then
13591360
Some (DExternal (translate_cc meta, translate_flags meta, name, translate_type env t0, arg_names))
13601361
else begin
1361-
Format.print1_warning "Not extracting %s to KaRaMeL (polymorphic assumes are not supported)\n" (Syntax.string_of_mlpath name);
1362+
if not (Options.silent ()) then
1363+
Format.print1_warning "Not extracting %s to KaRaMeL (polymorphic assumes are not supported)\n" (Syntax.string_of_mlpath name);
13621364
None
13631365
end
13641366

@@ -1382,7 +1384,7 @@ let translate_let' env flavor lb: option decl =
13821384
in
13831385
let name = env.module_name, name in
13841386
let i, eff, t = find_return_type E_PURE (List.length args) t0 in
1385-
if i > 0 then begin
1387+
if i > 0 && not (Options.silent ()) then begin
13861388
let msg = "function type annotation has less arrows than the \
13871389
number of arguments; please mark the return type abbreviation as \
13881390
inline_for_extraction" in
@@ -1495,7 +1497,8 @@ let translate_decl env d: list decl =
14951497
failwith "todo: translate_decl [MLM_Top]"
14961498

14971499
| MLM_Exn (m, _) ->
1498-
Format.print1_warning "Not extracting exception %s to KaRaMeL (exceptions unsupported)\n" m;
1500+
if not (Options.silent ()) then
1501+
Format.print1_warning "Not extracting exception %s to KaRaMeL (exceptions unsupported)\n" m;
14991502
[]
15001503

15011504
let translate_module uenv (m : mlpath & option (mlsig & mlmodulebody)) : file =

0 commit comments

Comments
 (0)