diff options
author | 2012-12-04 23:26:31 +0000 | |
---|---|---|
committer | 2012-12-04 23:26:31 +0000 | |
commit | abb4e7b0c1e8c0a5cc68052446333981379020d4 (patch) | |
tree | 6f061d1fe16925d75f1fcc534098cc5110866307 | |
parent | 70c317542bf20e98bb98bb1fc3be66912bad2ffd (diff) |
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
-rw-r--r-- | parsing/compat.ml4 | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/parsing/compat.ml4 b/parsing/compat.ml4 index 9219cc86e..52b3149bb 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 |