@@ -70,10 +70,10 @@ functor
7070 (* *****************************************************************)
7171 (* operations of module signatures*)
7272
73- let init ?compil ?files ~called_from () =
73+ let init ?compil ?files ?( is_a_patch = false ) ~called_from () =
7474 match compil with
7575 | Some compil ->
76- let parameters = Remanent_parameters. get_parameters ~called_from () in
76+ let parameters = Remanent_parameters. get_parameters ~called_from ~is_a_patch () in
7777 let state =
7878 Remanent_state. create_state parameters (Remanent_state. Compil compil)
7979 in
@@ -85,9 +85,9 @@ functor
8585 let errors = Exception. empty_exceptions_caught_and_uncaught in
8686 let errors, parameters, files =
8787 match files with
88- | None -> Get_option. get_option errors
88+ | None -> Get_option. get_option ~is_a_patch errors
8989 | Some x ->
90- let a, b, _ = Get_option. get_option errors in
90+ let a, b, _ = Get_option. get_option ~is_a_patch errors in
9191 a, b, x
9292 in
9393 let log = Remanent_parameters. get_logger parameters in
@@ -287,6 +287,7 @@ functor
287287 let parameters = get_parameters state in
288288 let syntax_version = Remanent_parameters. get_syntax_version parameters in
289289 let removed_rules = Remanent_parameters. get_rules_to_remove parameters in
290+ let is_a_patch = Remanent_parameters. get_is_a_patch parameters in
290291 let current_chapter =
291292 Remanent_parameters. get_current_chapter parameters
292293 in
@@ -300,6 +301,11 @@ functor
300301 | Remanent_state. Files files ->
301302 let () = show_title state in
302303 (try
304+ if is_a_patch then
305+ ( errors,
306+ Cli_init. get_ast_from_list_of_files ~current_chapter: files ~rules_in_ws: []
307+ ~removed_rules: [] syntax_version [] )
308+ else
303309 ( errors,
304310 Cli_init. get_ast_from_list_of_files ~current_chapter ~rules_in_ws
305311 ~removed_rules syntax_version files )
@@ -2438,7 +2444,7 @@ functor
24382444 | Some false | None -> false
24392445 in
24402446 let errors = get_errors state in
2441- let state' = init ~called_from ?compil ?files () in
2447+ let state' = init ~called_from ?compil ?files ~is_a_patch: true () in
24422448 let state' = set_errors errors state' in
24432449 let state', _ = get_compilation state' in
24442450 let state' =
0 commit comments