From: Andrea Asperti Date: Tue, 27 Jan 2004 12:32:25 +0000 (+0000) Subject: test for empty string given, if so return Environment.empty without invoking the... X-Git-Tag: V_0_2_3~135 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=4831d31010f88f277a41ad32cb2c58d3f705820f;p=helm.git test for empty string given, if so return Environment.empty without invoking the parser --- diff --git a/helm/ocaml/cic_disambiguation/cicTextualParser2.ml b/helm/ocaml/cic_disambiguation/cicTextualParser2.ml index bca1cdba6..42b75e9dd 100644 --- a/helm/ocaml/cic_disambiguation/cicTextualParser2.ml +++ b/helm/ocaml/cic_disambiguation/cicTextualParser2.ml @@ -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