]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/cic_disambiguation/cicTextualParser2.ml
test for empty string given, if so return Environment.empty without invoking the...
[helm.git] / helm / ocaml / cic_disambiguation / cicTextualParser2.ml
index bca1cdba639c2ac89f49dfac27e17c94004fa010..42b75e9dde5b8db6f80caa021bcf5261e81d1d47 100644 (file)
@@ -243,10 +243,13 @@ module EnvironmentP3 =
     END
 
     let of_string s =
-      try
-        Grammar.Entry.parse aliases (Stream.of_string s)
-      with Stdpp.Exc_located ((x, y), exn) ->
-        raise (Parse_error (sprintf "parse error at characters %d-%d: %s" x y
+      if s = empty then
+        Environment.empty
+      else
+        try
+          Grammar.Entry.parse aliases (Stream.of_string s)
+        with Stdpp.Exc_located ((x, y), exn) ->
+          raise (Parse_error (sprintf "parse error at characters %d-%d: %s" x y
           (Printexc.to_string exn)))
   end