Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-snezhko committed Jun 1, 2023
1 parent 685cb5f commit 74083da
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 30 deletions.
14 changes: 4 additions & 10 deletions compiler/src/formatting/format.re
Expand Up @@ -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) {
Expand Down
10 changes: 4 additions & 6 deletions compiler/src/typed/typed_well_formedness.re
Expand Up @@ -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));
};
};
Expand Down
16 changes: 2 additions & 14 deletions compiler/test/runner.re
Expand Up @@ -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) => {
Expand Down

0 comments on commit 74083da

Please sign in to comment.