summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Kahle <tomka@gentoo.org>2011-02-20 07:36:09 +0000
committerThomas Kahle <tomka@gentoo.org>2011-02-20 07:36:09 +0000
commit40cf4ae4a8ffb5da82539d909690f11d9700af75 (patch)
treeaad146e3582bac832d75cf31de1c902e57fbfce0 /sci-mathematics/coq/files
parentRemove MY_P. (diff)
downloadgentoo-2-40cf4ae4a8ffb5da82539d909690f11d9700af75.tar.gz
gentoo-2-40cf4ae4a8ffb5da82539d909690f11d9700af75.tar.bz2
gentoo-2-40cf4ae4a8ffb5da82539d909690f11d9700af75.zip
Added camlp5-6 support to the 8.2 branch (bug 355297), patch by Jonathan-Christofer Demay
(Portage version: 2.1.9.40/cvs/Linux i686)
Diffstat (limited to 'sci-mathematics/coq/files')
-rw-r--r--sci-mathematics/coq/files/coq-8.2_p2-camlp5-6-compat.patch131
1 files changed, 131 insertions, 0 deletions
diff --git a/sci-mathematics/coq/files/coq-8.2_p2-camlp5-6-compat.patch b/sci-mathematics/coq/files/coq-8.2_p2-camlp5-6-compat.patch
new file mode 100644
index 000000000000..3734f75ffc15
--- /dev/null
+++ b/sci-mathematics/coq/files/coq-8.2_p2-camlp5-6-compat.patch
@@ -0,0 +1,131 @@
+diff -Naurp coq-8.2pl2/lib/compat.ml4 a/lib/compat.ml4
+--- coq-8.2pl2/lib/compat.ml4 2007-09-15 10:35:59.000000000 +0000
++++ a/lib/compat.ml4 2011-02-17 07:30:00.000000000 +0000
+@@ -69,3 +69,16 @@ let join_loc = M.join_loc
+ type token = M.token
+ type lexer = M.lexer
+ let using = M.using
++
++IFDEF CAMLP5_6_00 THEN
++
++let slist0sep x y = Gramext.Slist0sep (x, y, false)
++let slist1sep x y = Gramext.Slist1sep (x, y, false)
++
++ELSE
++
++let slist0sep x y = Gramext.Slist0sep (x, y)
++let slist1sep x y = Gramext.Slist1sep (x, y)
++
++END
++
+diff -Naurp coq-8.2pl2/parsing/pcoq.ml4 a/parsing/pcoq.ml4
+--- coq-8.2pl2/parsing/pcoq.ml4 2009-04-07 18:19:05.000000000 +0000
++++ a/parsing/pcoq.ml4 2011-02-17 07:30:45.000000000 +0000
+@@ -159,6 +159,11 @@ module Gram =
+ errorlabstrm "Pcoq.delete_rule" (str "GDELETE_RULE forbidden.")
+ end
+
++IFDEF CAMLP5_6_02_1 THEN
++let entry_print x = Gram.Entry.print !Pp_control.std_ft x
++ELSE
++let entry_print = Gram.Entry.print
++END
+
+ let camlp4_verbosity silent f x =
+ let a = !Gramext.warning_verbose in
+@@ -746,9 +751,9 @@ let rec symbol_of_production assoc from
+ | ETConstrList (typ',[]) ->
+ Gramext.Slist1 (symbol_of_production assoc from forpat (ETConstr typ'))
+ | ETConstrList (typ',tkl) ->
+- Gramext.Slist1sep
+- (symbol_of_production assoc from forpat (ETConstr typ'),
+- Gramext.srules
++ Compat.slist1sep
++ (symbol_of_production assoc from forpat (ETConstr typ'))
++ (Gramext.srules
+ [List.map (fun x -> Gramext.Stoken x) tkl,
+ List.fold_right (fun _ v -> Gramext.action (fun _ -> v)) tkl
+ (Gramext.action (fun loc -> ()))])
+diff -Naurp coq-8.2pl2/parsing/pcoq.mli a/parsing/pcoq.mli
+--- coq-8.2pl2/parsing/pcoq.mli 2009-01-14 11:36:32.000000000 +0000
++++ a/parsing/pcoq.mli 2011-02-17 07:30:52.000000000 +0000
+@@ -24,6 +24,8 @@ val lexer : Compat.lexer
+
+ module Gram : Grammar.S with type te = Compat.token
+
++val entry_print : 'a Gram.Entry.e -> unit
++
+ (* The superclass of all grammar entries *)
+ type grammar_object
+
+diff -Naurp coq-8.2pl2/parsing/q_util.ml4 a/parsing/q_util.ml4
+--- coq-8.2pl2/parsing/q_util.ml4 2008-08-06 10:30:35.000000000 +0000
++++ a/parsing/q_util.ml4 2011-02-17 07:31:00.000000000 +0000
+@@ -82,7 +82,7 @@ let modifiers e =
+ <:expr< Gramext.srules
+ [([], Gramext.action(fun _loc -> []));
+ ([Gramext.Stoken ("", "(");
+- Gramext.Slist1sep ($e$, Gramext.Stoken ("", ","));
++ Compat.slist1sep ($e$) (Gramext.Stoken ("", ","));
+ Gramext.Stoken ("", ")")],
+ Gramext.action (fun _ l _ _loc -> l))]
+ >>
+@@ -96,7 +96,7 @@ let rec interp_entry_name loc s sep =
+ String.sub s (l-9) 9 = "_list_sep" then
+ let t, g = interp_entry_name loc (String.sub s 3 (l-12)) "" in
+ let sep = <:expr< Gramext.Stoken("",$str:sep$) >> in
+- List1ArgType t, <:expr< Gramext.Slist1sep $g$ $sep$ >>
++ List1ArgType t, <:expr< Compat.slist1sep $g$ $sep$ >>
+ else if l > 5 & String.sub s (l-5) 5 = "_list" then
+ let t, g = interp_entry_name loc (String.sub s 0 (l-5)) "" in
+ List0ArgType t, <:expr< Gramext.Slist0 $g$ >>
+diff -Naurp coq-8.2pl2/toplevel/metasyntax.ml a/toplevel/metasyntax.ml
+--- coq-8.2pl2/toplevel/metasyntax.ml 2010-03-23 22:34:38.000000000 +0000
++++ a/toplevel/metasyntax.ml 2011-02-17 07:30:35.000000000 +0000
+@@ -100,33 +100,33 @@ let add_tactic_notation (n,prods,e) =
+ let print_grammar = function
+ | "constr" | "operconstr" | "binder_constr" ->
+ msgnl (str "Entry constr is");
+- Gram.Entry.print Pcoq.Constr.constr;
++ entry_print Pcoq.Constr.constr;
+ msgnl (str "and lconstr is");
+- Gram.Entry.print Pcoq.Constr.lconstr;
++ entry_print Pcoq.Constr.lconstr;
+ msgnl (str "where binder_constr is");
+- Gram.Entry.print Pcoq.Constr.binder_constr;
++ entry_print Pcoq.Constr.binder_constr;
+ msgnl (str "and operconstr is");
+- Gram.Entry.print Pcoq.Constr.operconstr;
++ entry_print Pcoq.Constr.operconstr;
+ | "pattern" ->
+- Gram.Entry.print Pcoq.Constr.pattern
++ entry_print Pcoq.Constr.pattern
+ | "tactic" ->
+ msgnl (str "Entry tactic_expr is");
+- Gram.Entry.print Pcoq.Tactic.tactic_expr;
++ entry_print Pcoq.Tactic.tactic_expr;
+ msgnl (str "Entry binder_tactic is");
+- Gram.Entry.print Pcoq.Tactic.binder_tactic;
++ entry_print Pcoq.Tactic.binder_tactic;
+ msgnl (str "Entry simple_tactic is");
+- Gram.Entry.print Pcoq.Tactic.simple_tactic;
++ entry_print Pcoq.Tactic.simple_tactic;
+ | "vernac" ->
+ msgnl (str "Entry vernac is");
+- Gram.Entry.print Pcoq.Vernac_.vernac;
++ entry_print Pcoq.Vernac_.vernac;
+ msgnl (str "Entry command is");
+- Gram.Entry.print Pcoq.Vernac_.command;
++ entry_print Pcoq.Vernac_.command;
+ msgnl (str "Entry syntax is");
+- Gram.Entry.print Pcoq.Vernac_.syntax;
++ entry_print Pcoq.Vernac_.syntax;
+ msgnl (str "Entry gallina is");
+- Gram.Entry.print Pcoq.Vernac_.gallina;
++ entry_print Pcoq.Vernac_.gallina;
+ msgnl (str "Entry gallina_ext is");
+- Gram.Entry.print Pcoq.Vernac_.gallina_ext;
++ entry_print Pcoq.Vernac_.gallina_ext;
+ | _ -> error "Unknown or unprintable grammar entry."
+
+ (**********************************************************************)