type context_node = qid option (* context node: None = root *)
-type 'a status = {
+type status = {
henv: environment; (* optimized global environment *)
path: D.id list; (* current section path *)
hcnt: environment; (* optimized context *)
node: context_node; (* current context node *)
nodes: context_node list; (* context node list *)
line: int; (* line number *)
- mk_uri:'a Y.uri_generator (* uri generator *)
+ mk_uri:Y.uri_generator (* uri generator *)
}
type resolver = Local of int
let lenv_of_cnt (a, ws) =
D.push C.start D.empty_lenv a (D.Abst ws)
-let mk_lref f i j k = f (D.LRef ([Y.Apix k], i, j))
+let mk_lref f i j k = f (D.TLRef ([Y.Apix k], i, j))
let id_of_name (id, _, _) = id
let str = String.concat "/" path in
let str = Filename.concat str id in
let f str = f (U.uri_of_string str, id, path) in
- st.mk_uri f str
+ f (st.mk_uri str)
let uri_of_qid (uri, _, _) = uri
let rec xlate_term f st lenv = function
| A.Sort s ->
- let f h = f (D.Sort ([], h)) in
+ let f h = f (D.TSort ([], h)) in
if s then f 0 else f 1
| A.Appl (v, t) ->
- let f vv tt = f (D.Appl ([], [vv], tt)) in
+ let f vv tt = f (D.TAppl ([], [vv], tt)) in
let f vv = xlate_term (f vv) st lenv t in
xlate_term f st lenv v
| A.Abst (name, w, t) ->
let f ww =
let a, b = [Y.Name (name, true)], (D.Abst [ww]) in
- let f tt = f (D.Bind (a, b, tt)) in
+ let f tt = f (D.TBind (a, b, tt)) in
let f lenv = xlate_term f st lenv t in
D.push f lenv a b
in
| _ -> assert false
in
let f tail =
- let f args = f (D.Appl ([], args, D.GRef ([], uri_of_qid qid))) in
+ let f args = f (D.TAppl ([], args, D.TGRef ([], uri_of_qid qid))) in
let f a = C.list_rev_map_append f map2 a ~tail in
C.list_sub_strict f a args
in
let f qid =
let f ww =
H.add st.henv (uri_of_qid qid) cnt;
- let b = Y.Abst (D.Bind (a, D.Abst ws, ww)) in
+ let b = Y.Abst (D.TBind (a, D.Abst ws, ww)) in
let entity = [Y.Mark st.line], uri_of_qid qid, b in
f {st with line = succ st.line} entity
in
let f qid =
let f ww vv =
H.add st.henv (uri_of_qid qid) cnt;
- let b = Y.Abbr (D.Bind (a, D.Abst ws, D.Cast ([], ww, vv))) in
+ let b = Y.Abbr (D.TBind (a, D.Abst ws, D.TCast ([], ww, vv))) in
let a =
if trans then [Y.Mark st.line] else [Y.Mark st.line; Y.Priv]
in