summaryrefslogtreecommitdiff
path: root/parsing/pcoq.ml4
diff options
context:
space:
mode:
Diffstat (limited to 'parsing/pcoq.ml4')
-rw-r--r--parsing/pcoq.ml429
1 files changed, 27 insertions, 2 deletions
diff --git a/parsing/pcoq.ml4 b/parsing/pcoq.ml4
index f7adfdd8..bf3cb084 100644
--- a/parsing/pcoq.ml4
+++ b/parsing/pcoq.ml4
@@ -6,7 +6,7 @@
(* * GNU Lesser General Public License Version 2.1 *)
(************************************************************************)
-(*i $Id: pcoq.ml4 9333 2006-11-02 13:59:14Z barras $ i*)
+(*i $Id: pcoq.ml4 10185 2007-10-06 18:05:13Z herbelin $ i*)
open Pp
open Util
@@ -29,6 +29,29 @@ open Ppextend
we unfreeze the state of the lexer. This restores the behaviour of the
lexer. B.B. *)
+IFDEF CAMLP5 THEN
+
+let lexer = {
+ Token.tok_func = Lexer.func;
+ Token.tok_using = Lexer.add_token;
+ Token.tok_removing = (fun _ -> ());
+ Token.tok_match = Token.default_match;
+ (* Token.parse = Lexer.tparse; *)
+ Token.tok_comm = None;
+ Token.tok_text = Lexer.token_text }
+
+module L =
+ struct
+ type te = string * string
+ let lexer = lexer
+ end
+
+(* The parser of Coq *)
+
+module G = Grammar.GMake(L)
+
+ELSE
+
let lexer = {
Token.func = Lexer.func;
Token.using = Lexer.add_token;
@@ -45,6 +68,8 @@ module L =
module G = Grammar.Make(L)
+END
+
let grammar_delete e rls =
List.iter
(fun (_,_,lev) ->
@@ -95,7 +120,7 @@ type ext_kind =
| ByGrammar of
grammar_object G.Entry.e * Gramext.position option *
(string option * Gramext.g_assoc option *
- (Token.t Gramext.g_symbol list * Gramext.g_action) list) list
+ (Compat.token Gramext.g_symbol list * Gramext.g_action) list) list
| ByGEXTEND of (unit -> unit) * (unit -> unit)
let camlp4_state = ref []