diff --git a/compiler/src/formatting/format.re b/compiler/src/formatting/format.re index fbf94a8ef9..74bd2d7d7b 100644 --- a/compiler/src/formatting/format.re +++ b/compiler/src/formatting/format.re @@ -5235,18 +5235,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 3db97163d9..9e702ec4f4 100644 --- a/compiler/src/typed/typed_well_formedness.re +++ b/compiler/src/typed/typed_well_formedness.re @@ -297,12 +297,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 ae089fc23c..6a17e55b39 100644 --- a/compiler/test/runner.re +++ b/compiler/test/runner.re @@ -212,20 +212,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) => {