anchor.diff:      if repl_stack_empty () then cleanup st'.repl_env;
       st'
   
  -let push_repl push_kind (st: full_repl_state) =
  +let push_repl push_kind st =
     repl_stack := st :: !repl_stack;
     push (set_check_kind st.repl_env push_kind) ""
   
  -let json_of_repl_state (st: repl_state) =
  +let json_of_repl_state st =
     let filenames (task, _) =
       match task with
       | LDInterleaved (intf, impl) -> [intf.tf_fname; impl.tf_fname]
       | LDSingle intf_or_impl -> [intf_or_impl.tf_fname]
       | LDInterfaceOfCurrentFile intf -> [intf.tf_fname] in
   
  -  let deps =
  -    match st with
  -    | PartialReplState pst -> pst.prepl_deps
  -    | FullReplState st -> st.repl_deps in
     JsonAssoc
       [("loaded-dependencies",
  -      JsonList (List.map JsonStr (List.concatMap filenames deps)));
  +      JsonList (List.map JsonStr (List.concatMap filenames st.repl_deps)));
        ("options",
         JsonList (List.map json_of_fstar_option (current_fstar_options (fun _ -> true))))]
   
  
positive.code: 
  open FStar.Parser.ParseIt
  
  type partial_repl_state =
    { prepl_env: env_t;
      prepl_fname: string;
      prepl_stdin: stream_reader;
      prepl_names: CompletionTable.table;
      prepl_deps: list<completed_dep_task> }
  
  type full_repl_state = { repl_line: int; repl_column: int; repl_fname: string;
                           repl_deps: list<completed_dep_task>;
                           repl_curmod: option<Syntax.Syntax.modul>;
                           repl_env: env_t;
                           repl_stdin: stream_reader;
                           repl_names: CTable.table }
  
  type repl_state =
  | PartialReplState of partial_repl_state
  | FullReplState of full_repl_state
  
  let wrap_repl_state fn r =
    match r with
    | (status, Inr n) -> (status, Inr n)
    | (status, Inl full_st) -> (status, Inl (fn full_st))
  
  let repl_stdin = function
    | PartialReplState st -> st.prepl_stdin
    | FullReplState st -> st.repl_stdin
  
  let repl_fname = function
    | PartialReplState st -> st.prepl_fname
    | FullReplState st -> st.repl_fname
  
  let repl_stack: ref<list<full_repl_state>> = Util.mk_ref []
  
  let repl_stack_empty () =
    match !repl_stack with
  
negative.code:   | Some (CTable.Namespace ns_info) ->
      Inr ("namespace", CTable.alist_of_ns_info ns_info)
  
  let run_code_lookup st symbol pos_opt requested_info =
    match run_symbol_lookup st symbol pos_opt requested_info with
    | Inr alist -> Inr alist
    | Inl _ -> match run_module_lookup st symbol with
              | Inr alist -> Inr alist
              | Inl err_msg -> Inl "No such symbol, module, or namespace."
  
  let run_lookup' st symbol context pos_opt requested_info =
    match context with
    | LKSymbolOnly -> run_symbol_lookup st symbol pos_opt requested_info
    | LKModule -> run_module_lookup st symbol
    | LKOption -> run_option_lookup symbol
    | LKCode -> run_code_lookup st symbol pos_opt requested_info
  
  let run_lookup st symbol context pos_opt requested_info =
    match run_lookup' st symbol context pos_opt requested_info with
    | Inl err_msg ->
      ((QueryNOK, JsonStr err_msg), Inl st)
  