From abb4e7b0c1e8c0a5cc68052446333981379020d4 Mon Sep 17 00:00:00 2001 From: herbelin Date: Tue, 4 Dec 2012 23:26:31 +0000 Subject: Early translation of camlp4/camlp5 located errors into coq-located errors so as to be able to work only with Loc.Exc_located inside main Coq. This fixes the anomaly (probably introduced by commit 15847) when a syntax error arrives in coqc. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16022 85f007b7-540e-0410-9357-904b9bb8a0f7 --- parsing/compat.ml4 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/parsing/compat.ml4 b/parsing/compat.ml4 index 9219cc86e5..52b3149bb8 100644 --- a/parsing/compat.ml4 +++ b/parsing/compat.ml4 @@ -191,7 +191,9 @@ module GrammarMake (L:LexerSig) : GrammarSig = struct Gramext.position option * single_extend_statment list let action = Gramext.action let entry_create = Entry.create - let entry_parse = Entry.parse + let entry_parse e p = + try Entry.parse e p + with Exc_located (loc,e) -> raise (Loc.Exc_located (to_coqloc loc,e)) IFDEF CAMLP5_6_02_1 THEN let entry_print ft x = Entry.print ft x ELSE @@ -225,7 +227,9 @@ module GrammarMake (L:LexerSig) : GrammarSig = struct let parsable s = s let action = Action.mk let entry_create = Entry.mk - let entry_parse e s = parse e (*FIXME*)CompatLoc.ghost s + let entry_parse e s = + try parse e (*FIXME*)CompatLoc.ghost s + with Exc_located (loc,e) -> raise (Loc.Exc_located (to_coqloc loc,e)) let entry_print ft x = Entry.print ft x let srules' = srules (entry_create "dummy") end -- cgit v1.2.3