]> matita.cs.unibo.it Git - helm.git/commitdiff
- coercion now requires an URI
authorStefano Zacchiroli <zack@upsilon.cc>
Mon, 12 Dec 2005 16:01:04 +0000 (16:01 +0000)
committerStefano Zacchiroli <zack@upsilon.cc>
Mon, 12 Dec 2005 16:01:04 +0000 (16:01 +0000)
- ported to new pattern type

helm/ocaml/grafite_parser/grafiteDisambiguate.ml
helm/ocaml/grafite_parser/grafiteDisambiguate.mli
helm/ocaml/grafite_parser/grafiteParser.ml

index 3c79cc0405806d1cd4b01f88b1eacbcbfbe56985..7b6b69d44479efacd2ecba74b1030e0e465acfa7 100644 (file)
@@ -69,7 +69,7 @@ let disambiguate_lazy_term status_ref term =
 
 let disambiguate_pattern status_ref (wanted, hyp_paths, goal_path) =
   let interp path = Disambiguate.interpretate_path [] path in
-  let goal_path = interp goal_path in
+  let goal_path = HExtlib.map_option interp goal_path in
   let hyp_paths = List.map (fun (name, path) -> name, interp path) hyp_paths in
   let wanted =
    match wanted with
@@ -78,7 +78,7 @@ let disambiguate_pattern status_ref (wanted, hyp_paths, goal_path) =
        let wanted = disambiguate_lazy_term status_ref wanted in
        Some wanted
   in
-  (wanted, hyp_paths ,goal_path)
+  (wanted, hyp_pathsgoal_path)
 
 let disambiguate_reduction_kind aliases_ref = function
   | `Unfold (Some t) ->
@@ -233,6 +233,7 @@ let disambiguate_obj status obj =
 let disambiguate_command status =
   function
   | GrafiteAst.Alias _
+  | GrafiteAst.Coercion _
   | GrafiteAst.Default _
   | GrafiteAst.Drop _
   | GrafiteAst.Dump _
@@ -243,10 +244,7 @@ let disambiguate_command status =
   | GrafiteAst.Render _
   | GrafiteAst.Set _ as cmd ->
       status,cmd
-  | GrafiteAst.Coercion (loc, term, add_composites) ->
-      let status_ref = ref status in
-      let term = disambiguate_term ~context:[] status_ref ~-1 term in
-      !status_ref, GrafiteAst.Coercion (loc,term,add_composites)
   | GrafiteAst.Obj (loc,obj) ->
       let status,obj = disambiguate_obj status obj in
       status, GrafiteAst.Obj (loc,obj)
+
index 21836853f05aec0108b30c39879a837168abdedb..379b65c1e17d39ae5dc0736a2fbf19c448ef1ef6 100644 (file)
@@ -32,5 +32,6 @@ val disambiguate_tactic:
 
 val disambiguate_command: 
  GrafiteTypes.status ->
-  (CicNotationPt.term, CicNotationPt.obj) GrafiteAst.command ->
-  GrafiteTypes.status * (Cic.term, Cic.obj) GrafiteAst.command
+  CicNotationPt.obj GrafiteAst.command ->
+  GrafiteTypes.status * Cic.obj GrafiteAst.command
+
index f76528567f3387a794bf57027c5c5ff87b5c23c4..aa60c87c43267e823461716190a859050117c26b 100644 (file)
@@ -72,9 +72,9 @@ EXTEND
      goal_path = OPT [ SYMBOL <:unicode<vdash>>; term = tactic_term -> term ] ->
       let goal_path =
        match goal_path, hyp_paths with
-          None, [] -> Ast.UserInput
-        | None, _::_ -> Ast.Implicit
-        | Some goal_path, _ -> goal_path
+          None, [] -> Some Ast.UserInput
+        | None, _::_ -> None
+        | Some goal_path, _ -> Some goal_path
       in
        hyp_paths,goal_path
    ]
@@ -91,12 +91,12 @@ EXTEND
         ] ->
          let wanted,hyp_paths,goal_path =
           match wanted_and_sps with
-             wanted,None -> wanted, [], Ast.UserInput
+             wanted,None -> wanted, [], Some Ast.UserInput
            | wanted,Some (hyp_paths,goal_path) -> wanted,hyp_paths,goal_path
          in
           wanted, hyp_paths, goal_path ] ->
       match res with
-         None -> None,[],Ast.UserInput
+         None -> None,[],Some Ast.UserInput
        | Some ps -> ps]
   ];
   direction: [
@@ -476,10 +476,8 @@ EXTEND
             ind_types
         in
         GrafiteAst.Obj (loc, Ast.Inductive (params, ind_types))
-    | IDENT "coercion" ; name = IDENT -> 
-        GrafiteAst.Coercion (loc, Ast.Ident (name,Some []), true)
-    | IDENT "coercion" ; name = URI -> 
-        GrafiteAst.Coercion (loc, Ast.Uri (name,Some []), true)
+    | IDENT "coercion" ; suri = URI ->
+        GrafiteAst.Coercion (loc, UriManager.uri_of_string suri, true)
     | IDENT "alias" ; spec = alias_spec ->
         GrafiteAst.Alias (loc, spec)
     | IDENT "record" ; (params,name,ty,fields) = record_spec ->