From 4831d31010f88f277a41ad32cb2c58d3f705820f Mon Sep 17 00:00:00 2001 From: Andrea Asperti Date: Tue, 27 Jan 2004 12:32:25 +0000 Subject: [PATCH] test for empty string given, if so return Environment.empty without invoking the parser --- helm/ocaml/cic_disambiguation/cicTextualParser2.ml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 -- 2.39.2