anchor.diff:  module TcErr = FStar.TypeChecker.Err
   module TcEnv = FStar.TypeChecker.Env
   module CTable = FStar.Interactive.CompletionTable
  -
  -exception ExitREPL of int
   
   (** Checkpoint the current (typechecking and desugaring) environment **)
   let push env msg =
  
positive.code:     eh_report = report;
      eh_clear = clear }
  
  let interactive_printer =
    { printer_prinfo = (fun s -> write_message "info" (JsonStr s));
      printer_prwarning = (fun s -> write_message "warning" (JsonStr s));
      printer_prerror = (fun s -> write_message "error" (JsonStr s));
      printer_prgeneric = (fun label get_string get_json -> write_message label (get_json ()) )}
  
  let initial_range =
    Range.mk_range "<input>" (Range.mk_pos 1 0) (Range.mk_pos 1 0)
  
  let interactive_mode' (filename: string): unit =
    write_hello ();
  
    let env = init_env FStar.Parser.Dep.empty_deps in
    let env = FStar.TypeChecker.Env.set_range env initial_range in
  
    let init_st =
      { repl_line = 1; repl_column = 0; repl_fname = filename;
        repl_curmod = None; repl_env = env; repl_deps_stack = [];
        repl_stdin = open_stdin ();
        repl_names = CompletionTable.empty } in
  
    let exit_code =
      if FStar.Options.record_hints() || FStar.Options.use_hints() then
  
negative.code:           { qid = q.qid; qq = GenericError "Current module unset" }
          | _ -> q
  
  (** This is the body of the JavaScript port's main loop. **)
  let single_repl_iteration js_query st =
    let query = safe_unpack_interactive_query js_query |> validate_query st in
    let (status, response), state_opt = run_query st query.qq in
    let js_response = json_of_response query.qid status response in
    js_response, state_opt
  
  (** This is the main loop for the desktop version **)
  let rec go st : int =
    let query = read_interactive_query st.repl_stdin |> validate_query st in
    let (status, response), state_opt = run_query st query.qq in
    write_response query.qid status response;
    match state_opt with
    | Inl st' -> go st'
    | Inr exitcode -> exitcode
  
  let interactive_error_handler = // No printing here — collect everything for future use
    let issues : ref<list<issue>> = Util.mk_ref [] in
  