Skip to content

Commit

Permalink
No longer ignore always annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
vouillon committed Sep 12, 2024
1 parent 2b9aae5 commit fb58a7e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
16 changes: 7 additions & 9 deletions compiler/lib/linker.ml
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ let list_all ?from () =
provided
StringSet.empty

let load_fragment ~ignore_always_annotation ~target_env ~filename (f : Fragment.t) =
let load_fragment ~target_env ~filename (f : Fragment.t) =
match f with
| Always_include code ->
always_included :=
Expand Down Expand Up @@ -482,8 +482,6 @@ let load_fragment ~ignore_always_annotation ~target_env ~filename (f : Fragment.
filename;
if always
then (
if not ignore_always_annotation
then
always_included :=
{ ar_filename = filename; ar_program = code; ar_requires = requires }
:: !always_included;
Expand Down Expand Up @@ -588,24 +586,24 @@ let check_deps () =
())
code_pieces

let load_file ~ignore_always_annotation ~target_env filename =
let load_file ~target_env filename =
List.iter (Fragment.parse_file filename) ~f:(fun frag ->
let (`Ok | `Ignored) =
load_fragment ~ignore_always_annotation ~target_env ~filename frag
load_fragment ~target_env ~filename frag
in
())

let load_fragments ?(ignore_always_annotation = false) ~target_env ~filename l =
let load_fragments ~target_env ~filename l =
List.iter l ~f:(fun frag ->
let (`Ok | `Ignored) =
load_fragment ~ignore_always_annotation ~target_env ~filename frag
load_fragment ~target_env ~filename frag
in
());
check_deps ()

let load_files ?(ignore_always_annotation = false) ~target_env l =
let load_files ~target_env l =
List.iter l ~f:(fun filename ->
load_file ~ignore_always_annotation ~target_env filename);
load_file ~target_env filename);
check_deps ()

(* resolve *)
Expand Down
5 changes: 2 additions & 3 deletions compiler/lib/linker.mli
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,10 @@ end
val reset : unit -> unit

val load_files :
?ignore_always_annotation:bool -> target_env:Target_env.t -> string list -> unit
target_env:Target_env.t -> string list -> unit

val load_fragments :
?ignore_always_annotation:bool
-> target_env:Target_env.t
target_env:Target_env.t
-> filename:string
-> Fragment.t list
-> unit
Expand Down

0 comments on commit fb58a7e

Please sign in to comment.