@@ -390,6 +390,35 @@ let o_split ?rev env i s =
390390 try Pos. may_split_at_cpos1 ?rev env i s
391391 with Pos. InvalidCPos -> raise (InvalidSplit (oget i))
392392
393+ (* Gap-based split functions *)
394+ let s_split_at_gap env (g : codegap1 ) s =
395+ let module Pos = EcMatching. Position in
396+ try Pos. split_at_cgap1 env g s
397+ with Pos. InvalidCPos ->
398+ let cp = match g with GapBefore cp | GapAfter cp -> cp in
399+ raise (InvalidSplit cp)
400+
401+ let o_split_at_gap ?rev env (g : codegap1 option ) s =
402+ let module Pos = EcMatching. Position in
403+ try Pos. may_split_at_cgap1 ?rev env g s
404+ with Pos. InvalidCPos ->
405+ let cp = match oget g with GapBefore cp | GapAfter cp -> cp in
406+ raise (InvalidSplit cp)
407+
408+ (* -------------------------------------------------------------------- *)
409+ (* Gap processing functions *)
410+ let tc1_process_codegap1 tc (side , g ) =
411+ let me, _ = tc1_get_stmt side tc in
412+ let env = FApi. tc1_env tc in
413+ let env = EcEnv.Memory. push_active_ss me env in
414+ EcTyping. trans_codegap1 env g
415+
416+ let tc1_process_codegap tc (side , g ) =
417+ let me, _ = tc1_get_stmt side tc in
418+ let env = FApi. tc1_env tc in
419+ let env = EcEnv.Memory. push_active_ss me env in
420+ EcTyping. trans_codegap env g
421+
393422(* -------------------------------------------------------------------- *)
394423let t_hS_or_bhS_or_eS ?th ?teh ?tbh ?te tc =
395424 match (FApi. tc1_goal tc).f_node with
0 commit comments