Soilihi BEN SOILIHI BOINA pushed to branch soilih at Stefan / Typer
Commits: 31c030ee by Soilih BEN SOILIH at 2021-08-15T23:03:03-06:00 fixing context errors
- - - - -
1 changed file:
- src/typer_lsp_server.ml
Changes:
===================================== src/typer_lsp_server.ml ===================================== @@ -313,7 +313,7 @@ let update_the_context (ctx: Debruijn.lexp_context) (liste : (vname * Lexp.lexp
let rec foo (ctx: Debruijn.lexp_context) (liste : (vname * Lexp.lexp * Lexp.ltype) list list ) (list_ret: (Debruijn.lexp_context * (vname * Lexp.lexp * Lexp.ltype) list) list) = match liste with - | [] -> failwith "No context to extend !!!" + | [] -> list_ret | hd::tl -> let lctx = Debruijn.lctx_extend_rec ctx hd in let elt = (lctx,hd) in foo lctx tl (elt::list_ret) @@ -438,9 +438,9 @@ let update_the_context (ctx: Debruijn.lexp_context) (liste : (vname * Lexp.lexp defs in
- let lt = (ctx,None, Lexp.mkSusp (Opslexp.get_type ctx e) (Opslexp.lexp_defs_subst l Subst.identity defs),l) in + (*let lt = (ctx,None, Lexp.mkSusp (Opslexp.get_type ctx e) (Opslexp.lexp_defs_subst l Subst.identity defs),l) in*)
- browse_list_lexp ((browse_lexp ctx' e cursor)::lt::tab) cursor + browse_list_lexp ((browse_lexp ctx' e cursor)::tab) cursor
@@ -459,7 +459,7 @@ let update_the_context (ctx: Debruijn.lexp_context) (liste : (vname * Lexp.lexp | Lambda (ak, ((l,_) as v), t, e) -> let ctx' = Debruijn.lctx_extend ctx v Variable t in let a = browse_lexp ctx' e cursor in let b = browse_lexp ctx t cursor in - let c = (ctx,None,(Opslexp.get_type ctx e),l) in + let c = (ctx,None,t,l) in browse_list_lexp ([a;b;c]) cursor
| Call (f, args) @@ -712,7 +712,8 @@ let rec find_def_location (ctx:Debruijn.lexp_context) (ret : Debruijn.lexp_conte match vr with | None -> loc | Some v -> let ((l,_),_,_) = Debruijn.lctx_lookup ctx v in - l + + {l with start_line = (l.start_line - 1); end_line = (l.end_line - 1)}
(*====================================Definition===================================*)
View it on GitLab: https://gitlab.com/monnier/typer/-/commit/31c030ee1a6cddfaa2f8901b3467e0b9f2...
Afficher les réponses par date