diff --git a/compiler/src/formatting/format.re b/compiler/src/formatting/format.re index af891cf66d..30c8b7caec 100644 --- a/compiler/src/formatting/format.re +++ b/compiler/src/formatting/format.re @@ -5257,18 +5257,12 @@ let format_ast = ); let attrs = ( - if (parsed_program.attributes.no_pervasives) { - [(Location.mknoloc("noPervasives"), [])]; - } else { - []; - } + parsed_program.attributes.no_pervasives + ? [(Location.mknoloc("noPervasives"), [])] : [] ) @ ( - if (parsed_program.attributes.runtime_mode) { - [(Location.mknoloc("runtimeMode"), [])]; - } else { - []; - } + parsed_program.attributes.runtime_mode + ? [(Location.mknoloc("runtimeMode"), [])] : [] ); let compile_flags_attr = switch (attrs) { diff --git a/compiler/src/typed/typed_well_formedness.re b/compiler/src/typed/typed_well_formedness.re index 0d5159a42b..31bb973470 100644 --- a/compiler/src/typed/typed_well_formedness.re +++ b/compiler/src/typed/typed_well_formedness.re @@ -337,12 +337,10 @@ module WellFormednessArg: TypedtreeIter.IteratorArgument = { }; // For now, we only raise the error inside of functions. if (exp_is_wasm_unsafe(exp) - && !( - Grain_utils.Config.no_gc^ - || Grain_utils.Config.compilation_mode^ - == Grain_utils.Config.Runtime - || is_unsafe() - )) { + && ! + Grain_utils.Config.( + no_gc^ || compilation_mode^ == Runtime || is_unsafe() + )) { raise(Error(exp_loc, WasmOutsideDisableGc)); }; }; diff --git a/compiler/test/runner.re b/compiler/test/runner.re index 3a0eb3baff..654fb8619a 100644 --- a/compiler/test/runner.re +++ b/compiler/test/runner.re @@ -222,20 +222,8 @@ let module_header = "module Test; "; let create_module_attributes = attributes => Grain_parsing.Parsetree.( - ( - if (attributes.no_pervasives) { - "@noPervasives\n"; - } else { - ""; - } - ) - ++ ( - if (attributes.runtime_mode) { - "@runtimeMode\n"; - } else { - ""; - } - ) + (attributes.no_pervasives ? "@noPervasives\n" : "") + ++ (attributes.runtime_mode ? "@runtimeMode\n" : "") ); let makeSnapshotRunner = (~config_fn=?, test, name, prog) => { @@ -326,7 +314,7 @@ let makeRunner = test, ~num_pages=?, ~config_fn=?, - ~extra_args=?, + ~extra_args=?, ~attributes=Test_utils.default_module_attributes, name, prog,