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