Skip to content

Commit

Permalink
remove unnecessary fields from OptionState
Browse files Browse the repository at this point in the history
  • Loading branch information
gfngfn committed Oct 29, 2023
1 parent 3a2cadc commit 5176297
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 36 deletions.
15 changes: 6 additions & 9 deletions src/backend/optionState.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
open MyUtil

type build_state = {
input_file : abs_path;
output_file : abs_path option;
type_check_only : bool;
input_file : abs_path;
}

type test_state = {
input_file_to_test : abs_path;
input_file_to_test : abs_path;
}

type command_state =
Expand All @@ -17,10 +15,8 @@ type command_state =
| SolveState

type state = {
command_state : command_state;
extra_config_paths : (string list) option;
show_full_path : bool;
no_default_config : bool;
command_state : command_state;
show_full_path : bool;
}


Expand All @@ -44,7 +40,8 @@ let get_input_file () =
| SolveState -> assert false


let does_show_full_path () = (get ()).show_full_path
let does_show_full_path () =
(get ()).show_full_path


let job_directory () =
Expand Down
16 changes: 5 additions & 11 deletions src/backend/optionState.mli
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
open MyUtil

type build_state = {
input_file : abs_path;
output_file : abs_path option;
type_check_only : bool;
input_file : abs_path;
}

type test_state = {
input_file_to_test : abs_path;
input_file_to_test : abs_path;
}

type command_state =
Expand All @@ -17,16 +15,12 @@ type command_state =
| SolveState

type state = {
command_state : command_state;
extra_config_paths : (string list) option;
show_full_path : bool;
no_default_config : bool;
command_state : command_state;
show_full_path : bool;
}

val set : state -> unit

val get : unit -> state

val does_show_full_path : unit -> bool
val does_show_full_path : unit -> bool

val job_directory : unit -> string
18 changes: 2 additions & 16 deletions src/frontend/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1657,15 +1657,8 @@ let build
}
in
OptionState.set OptionState.{
command_state =
BuildState{
input_file;
output_file;
type_check_only;
};
extra_config_paths;
command_state = BuildState{ input_file };
show_full_path;
no_default_config;
};

let library_root = setup_root_dirs ~no_default_config ~extra_config_paths curdir in
Expand Down Expand Up @@ -1798,13 +1791,8 @@ let test
}
in
OptionState.set OptionState.{
command_state =
TestState{
input_file_to_test;
};
extra_config_paths;
command_state = TestState{ input_file_to_test };
show_full_path;
no_default_config;
};

let library_root = setup_root_dirs ~no_default_config ~extra_config_paths curdir in
Expand Down Expand Up @@ -2022,9 +2010,7 @@ let solve

OptionState.set OptionState.{
command_state = SolveState;
extra_config_paths;
show_full_path;
no_default_config;
};

let library_root = setup_root_dirs ~no_default_config ~extra_config_paths curdir in
Expand Down

0 comments on commit 5176297

Please sign in to comment.