From cf868740c3d18ee9ce9a6b38dd617784625a3cae Mon Sep 17 00:00:00 2001 From: Jim Fehrle Date: Wed, 9 Jan 2019 15:32:52 -0800 Subject: Introduce doc_gram, a utilty for extracting Coq's grammar from .mlg files and inserting it into the .rst files --- coqpp/coqpp_parser.ml | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 coqpp/coqpp_parser.ml (limited to 'coqpp/coqpp_parser.ml') diff --git a/coqpp/coqpp_parser.ml b/coqpp/coqpp_parser.ml new file mode 100644 index 0000000000..1fa47f554c --- /dev/null +++ b/coqpp/coqpp_parser.ml @@ -0,0 +1,44 @@ +(************************************************************************) +(* * The Coq Proof Assistant / The Coq Development Team *) +(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *) +(* + let () = close_in chan in + let () = Printf.eprintf "%s\n%!" (pr_loc loc) in + fatal msg + | Parsing.Parse_error -> + let () = close_in chan in + let loc = Coqpp_lex.loc lexbuf in + let () = Printf.eprintf "%s\n%!" (pr_loc loc) in + fatal "syntax error" + in + let () = close_in chan in + ans -- cgit v1.2.3