@@ -38,19 +38,19 @@ type 'x rewinder =
3838 ('x * ('x rewinder )) with_diags ;
3939 }
4040and preprocessor_rewind =
41- ?new_position: Lexing .position -> (Cobol_preproc.Preprocess .preprocessor as 'r ) -> 'r
41+ ?new_position: Lexing .position -> (Cobol_preproc.Main .preprocessor as 'r ) -> 'r
4242and position =
4343 | Lexing of Lexing .position
4444 | Indexed of { line : int ; char : int } (* all starting at 0 *)
4545
4646type 'm simple_parsing
4747 = ?options:parser_options
48- -> Cobol_preproc.Preprocess .preprocessor
48+ -> Cobol_preproc.Main .preprocessor
4949 -> (Cobol_ptree.Types .compilation_group option , 'm ) output DIAGS .with_diags
5050
5151type 'm rewindable_parsing
5252 = ?options:parser_options
53- -> Cobol_preproc.Preprocess .preprocessor
53+ -> Cobol_preproc.Main .preprocessor
5454 -> (((Cobol_ptree.Types .compilation_group option , 'm ) output as 'x ) *
5555 'x rewinder ) DIAGS .with_diags
5656
@@ -78,7 +78,7 @@ type 'm state =
7878 basis (mostly the pre-processor and tokenizer's states). *)
7979and 'm preproc =
8080 {
81- pp : Cobol_preproc.Preprocess .t ; (* also holds diagnostics *)
81+ pp : Cobol_preproc.Main .preprocessor ; (* also holds diagnostics *)
8282 tokzr : 'm Tokzr .state ;
8383 persist : 'm persist ;
8484 }
@@ -130,21 +130,21 @@ and update_tokzr ps tokzr =
130130 else { ps with preproc = { ps.preproc with tokzr } }
131131
132132let add_diag diag ({ preproc = { pp; _ } ; _ } as ps ) =
133- update_pp ps (Cobol_preproc.Preprocess . add_diag pp diag)
133+ update_pp ps (Cobol_preproc.Main . add_diag pp diag)
134134let add_diags diags ({ preproc = { pp; _ } ; _ } as ps ) =
135- update_pp ps (Cobol_preproc.Preprocess . add_diags pp diags)
135+ update_pp ps (Cobol_preproc.Main . add_diags pp diags)
136136
137137let all_diags { preproc = { pp; tokzr; _ } ; _ } =
138- DIAGS.Set. union (Cobol_preproc.Preprocess . diags pp) @@ Tokzr. diagnostics tokzr
138+ DIAGS.Set. union (Cobol_preproc.Main . diags pp) @@ Tokzr. diagnostics tokzr
139139
140140(* --- *)
141141
142142let rec produce_tokens (ps : _ state as 's ) : 's * Text_tokenizer.tokens =
143- let text, pp = Cobol_preproc.Preprocess . next_chunk ps.preproc.pp in
143+ let text, pp = Cobol_preproc.Main . next_chunk ps.preproc.pp in
144144 let { preproc = { pp; tokzr; _ }; _ } as ps = update_pp ps pp in
145145 assert (text <> [] );
146146 (* Note: this is the source format in use at the end of the sentence. *)
147- let source_format = Cobol_preproc.Preprocess . source_format pp in
147+ let source_format = Cobol_preproc.Main . source_format pp in
148148 match Tokzr. tokenize_text ~source_format tokzr text with
149149 | Error `MissingInputs , tokzr ->
150150 produce_tokens (update_tokzr ps tokzr)
@@ -396,7 +396,7 @@ let on_exn ps e =
396396let first_stage (ps : 'm state ) ~make_checkpoint : ('a , 'm ) stage =
397397 let ps, tokens = produce_tokens ps in
398398 let first_pos = match tokens with
399- | [] -> Cobol_preproc.Preprocess . position ps.preproc.pp
399+ | [] -> Cobol_preproc.Main . position ps.preproc.pp
400400 | t :: _ -> Cobol_common.Srcloc. start_pos ~@ t
401401 in
402402 normal ps tokens (make_checkpoint first_pos)
@@ -419,9 +419,9 @@ let aggregate_output (type m) (ps: m state) res
419419 | Eidetic ->
420420 let artifacts =
421421 { tokens = Tokzr. parsed_tokens ps.preproc.tokzr;
422- pplog = Cobol_preproc.Preprocess . rev_log ps.preproc.pp;
423- rev_comments = Cobol_preproc.Preprocess . rev_comments ps.preproc.pp;
424- rev_ignored = Cobol_preproc.Preprocess . rev_ignored ps.preproc.pp } in
422+ pplog = Cobol_preproc.Main . rev_log ps.preproc.pp;
423+ rev_comments = Cobol_preproc.Main . rev_comments ps.preproc.pp;
424+ rev_ignored = Cobol_preproc.Main . rev_ignored ps.preproc.pp } in
425425 WithArtifacts (res, artifacts)
426426
427427(* * Simple parsing *)
@@ -469,7 +469,7 @@ let init_rewindable_parse ps ~make_checkpoint =
469469
470470(* * Stores a stage as part of the memorized rewindable history events. *)
471471let save_interim_stage (ps , _ , env ) (store : _ rewindable_history ) =
472- let preproc_position = Cobol_preproc.Preprocess . position ps.preproc.pp in
472+ let preproc_position = Cobol_preproc.Main . position ps.preproc.pp in
473473 match store with
474474 | store'
475475 when preproc_position.pos_cnum <> preproc_position.pos_bol ->
@@ -516,7 +516,7 @@ let find_history_event_preceding ~position ({ store; _ } as rwps) =
516516 pos
517517 | Indexed { line; char } ->
518518 let ps = rewindable_parser_state rwps in
519- Cobol_preproc.Preprocess . position_at ~line ~char ps.preproc.pp
519+ Cobol_preproc.Main . position_at ~line ~char ps.preproc.pp
520520 in
521521 let rec aux = function
522522 | [] ->
@@ -560,7 +560,7 @@ let rec rewind_n_parse
560560
561561let rewindable_parse
562562 : options :_ -> memory :'m memory -> make_checkpoint :_
563- -> Cobol_preproc.Preprocess . preprocessor
563+ -> Cobol_preproc.Main . preprocessor
564564 -> ((('a option , 'm ) output as 'x ) * 'x rewinder ) with_diags =
565565 fun ~options ~memory ~make_checkpoint pp ->
566566 let res, rwps =
@@ -581,7 +581,7 @@ let parse
581581 (type m )
582582 ~(memory : m memory )
583583 ?(options = Options. default)
584- : Cobol_preproc.Preprocess . t ->
584+ : Cobol_preproc.Main . t ->
585585 (Cobol_ptree.Types. compilation_group option , m ) output with_diags =
586586 parse_once ~options ~memory
587587 ~make_checkpoint: Grammar.Incremental. compilation_group
@@ -593,7 +593,7 @@ let rewindable_parse
593593 (type m )
594594 ~(memory : m memory )
595595 ?(options = Options. default)
596- : Cobol_preproc.Preprocess . t ->
596+ : Cobol_preproc.Main . t ->
597597 (((Cobol_ptree.Types. compilation_group option , m ) output as 'x ) * 'x rewinder )
598598 with_diags =
599599 rewindable_parse ~options ~memory
0 commit comments