]> matita.cs.unibo.it Git - helm.git/commitdiff
Fixes a bug which caused Meta_not_found exceptions to be raised after qed-ing a
authorWilmer Ricciotti <ricciott@cs.unibo.it>
Wed, 17 Apr 2013 10:50:45 +0000 (10:50 +0000)
committerWilmer Ricciotti <ricciott@cs.unibo.it>
Wed, 17 Apr 2013 10:50:45 +0000 (10:50 +0000)
lemma with unskipped goals closed by side-effect.

matita/components/grafite_engine/grafiteEngine.ml
matita/matita/matitaScript.ml

index 54850f1126b707ca0d765809fea7573d0fe4b0e9..5086eb845c6424574c565f8471ecc96b216bac14 100644 (file)
@@ -663,6 +663,9 @@ let rec eval_ncommand ~include_paths opts status (text,prefix_len,cmd) =
             | _ -> status)
          else
           status in
+        (* purge tinycals stack *)
+        let ninitial_stack = Continuationals.Stack.of_nmetasenv [] in
+        let status = status#set_stack ninitial_stack in
 (*
          try 
            index_eq uri status
index d86871963437efbac813b5e63b590f98573af5ff..6a03e3538652c379234d31e76197627ab8d51a1a 100644 (file)
@@ -117,8 +117,13 @@ let eval_nmacro include_paths (buffer : GText.buffer) status unparsed_text parse
            if tl <> [] then
             HLog.warn
              "Many goals focused. Using the context of the first one\n";
-           let _, ctx, _ = NCicUtils.lookup_meta g menv in
-            ctx in
+           let ctx = try
+             let _, ctx, _ = NCicUtils.lookup_meta g menv in ctx
+             with NCicUtils.Meta_not_found _ -> 
+               HLog.warn "Current goal is closed. Using empty context.";
+               [ ]
+           in ctx
+      in
       let m, s, status, t = 
         GrafiteDisambiguate.disambiguate_nterm 
           status `XTNone ctx menv subst (parsed_text,parsed_text_length,