diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/compat5.ml | 13 | ||||
| -rw-r--r-- | tools/compat5.mlp | 23 | ||||
| -rw-r--r-- | tools/compat5b.ml | 13 | ||||
| -rw-r--r-- | tools/compat5b.mlp | 23 |
4 files changed, 72 insertions, 0 deletions
diff --git a/tools/compat5.ml b/tools/compat5.ml new file mode 100644 index 0000000000..6a76895cd9 --- /dev/null +++ b/tools/compat5.ml @@ -0,0 +1,13 @@ +(************************************************************************) +(* v * The Coq Proof Assistant / The Coq Development Team *) +(* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *) +(* \VV/ **************************************************************) +(* // * This file is distributed under the terms of the *) +(* * GNU Lesser General Public License Version 2.1 *) +(************************************************************************) + +(* This file is meant for camlp5, for which there is nothing to + add to gain camlp5 compatibility :-). + + See [compat5.mlp] for the [camlp4] counterpart +*) diff --git a/tools/compat5.mlp b/tools/compat5.mlp new file mode 100644 index 0000000000..c3c7e9995f --- /dev/null +++ b/tools/compat5.mlp @@ -0,0 +1,23 @@ +(************************************************************************) +(* v * The Coq Proof Assistant / The Coq Development Team *) +(* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *) +(* \VV/ **************************************************************) +(* // * This file is distributed under the terms of the *) +(* * GNU Lesser General Public License Version 2.1 *) +(************************************************************************) + +(** Adding a bit of camlp5 syntax to camlp4 for compatibility: + - GEXTEND ... becomes EXTEND ... +*) + +open Camlp4.PreCast + +let rec my_token_filter = parser + | [< '(KEYWORD "GEXTEND", loc); s >] -> + [< '(KEYWORD "EXTEND", loc); my_token_filter s >] + | [< 'tokloc; s >] -> [< 'tokloc; my_token_filter s >] + | [< >] -> [< >] + +let _ = + Token.Filter.define_filter (Gram.get_filter()) + (fun prev strm -> prev (my_token_filter strm)) diff --git a/tools/compat5b.ml b/tools/compat5b.ml new file mode 100644 index 0000000000..03bdb358b0 --- /dev/null +++ b/tools/compat5b.ml @@ -0,0 +1,13 @@ +(************************************************************************) +(* v * The Coq Proof Assistant / The Coq Development Team *) +(* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *) +(* \VV/ **************************************************************) +(* // * This file is distributed under the terms of the *) +(* * GNU Lesser General Public License Version 2.1 *) +(************************************************************************) + +(* This file is meant for camlp5, for which there is nothing to + add to gain camlp5 compatibility :-). + + See [compat5b.mlp] for the [camlp4] counterpart +*) diff --git a/tools/compat5b.mlp b/tools/compat5b.mlp new file mode 100644 index 0000000000..0aa13dd640 --- /dev/null +++ b/tools/compat5b.mlp @@ -0,0 +1,23 @@ +(************************************************************************) +(* v * The Coq Proof Assistant / The Coq Development Team *) +(* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *) +(* \VV/ **************************************************************) +(* // * This file is distributed under the terms of the *) +(* * GNU Lesser General Public License Version 2.1 *) +(************************************************************************) + +(** Adding a bit of camlp5 syntax to camlp4 for compatibility: + - EXTEND ... becomes EXTEND Gram ... +*) + +open Camlp4.PreCast + +let rec my_token_filter = parser + | [< '(KEYWORD "EXTEND",_ as t); s >] -> + [< 't; '(UIDENT "Gram", Loc.ghost); my_token_filter s >] + | [< 'tokloc; s >] -> [< 'tokloc; my_token_filter s >] + | [< >] -> [< >] + +let _ = + Token.Filter.define_filter (Gram.get_filter()) + (fun prev strm -> prev (my_token_filter strm)) |
