This is an automated email from the git hooks/post-receive script. mehdi pushed a commit to branch master in repository otags.
commit 9fcffef4744be772225e37569386256b57a5dca1 Author: Mehdi Dogguy <me...@debian.org> Date: Tue Jan 5 23:29:45 2016 +0100 Add patch to port to OCaml 4.02.3, patch from Hendrik Tews (Closes: #802166). --- debian/changelog | 7 + debian/patches/0001-Port-to-OCaml-4.02.3.patch | 224 +++++++++++++++++++++ .../0001-Set-required-version-to-4.02.patch | 22 -- debian/patches/series | 2 +- 4 files changed, 232 insertions(+), 23 deletions(-) diff --git a/debian/changelog b/debian/changelog index e5c64a6..7fe3d8c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +otags (4.01.1-3) UNRELEASED; urgency=medium + + * Add patch to port to OCaml 4.02.3, patch from Hendrik Tews + (Closes: #802166). + + -- Mehdi Dogguy <me...@debian.org> Tue, 05 Jan 2016 23:27:59 +0100 + otags (4.01.1-2) unstable; urgency=medium * Set OCaml 4.02 as required version diff --git a/debian/patches/0001-Port-to-OCaml-4.02.3.patch b/debian/patches/0001-Port-to-OCaml-4.02.3.patch new file mode 100644 index 0000000..e2c3d05 --- /dev/null +++ b/debian/patches/0001-Port-to-OCaml-4.02.3.patch @@ -0,0 +1,224 @@ +From: Mehdi Dogguy <me...@debian.org> +Date: Tue, 5 Jan 2016 23:24:22 +0100 +Subject: Port to OCaml 4.02.3 + +Patch from upstream +--- + ChangeLog | 5 ++++ + configure | 2 +- + tags.ml | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- + 3 files changed, 86 insertions(+), 5 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 50e1c68..21bf6ca 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,8 @@ ++2016-01-05 Hendrik Tews <hendrik.t...@fireeye.com> ++ ++ * adapt to ocaml 4.02: module aliases, attributes, ++ exception patterns, extensible variants ++ + 2013-09-25 Hendrik Tews <ot...@askra.de> + + * prepare doc/changes.html for release +diff --git a/configure b/configure +index d0e1bd3..e9e0c60 100755 +--- a/configure ++++ b/configure +@@ -29,7 +29,7 @@ + + set -e + +-REQUIRED_OCAML_VERSION=4.01 ++REQUIRED_OCAML_VERSION=4.02 + OTAGS_VERSION=1 + + root=/usr/local +diff --git a/tags.ml b/tags.ml +index 18cb14b..493488f 100644 +--- a/tags.ml ++++ b/tags.ml +@@ -40,6 +40,25 @@ let empty_str_ast = Struct_ast(<:str_item@no_loc< >>) + + (****************************************************************************** + * ++ ********************** utility functions ********************************* ++ * ++ ******************************************************************************) ++ ++ ++(** returns the first string of ident, return something arbitrary if ++ the first element of the ident is an antiquotation. ++*) ++let rec first_string_of_ident = function ++ | <:ident< $x$ . $_$ >> ++ | <:ident< $x$ $_$ >> -> first_string_of_ident x ++ | <:ident< $lid:x$ >> -> x ++ | <:ident< $uid:x$ >> -> x ++ | <:ident< $anti:_$ >> -> "xxx" ++ ++ ++ ++(****************************************************************************** ++ * + ********************** tagging functions ********************************* + * + ******************************************************************************) +@@ -101,6 +120,13 @@ let rec tag_type write_tag typ = match typ with + | _ -> assert false + ); + tag_type write_tag type_def ++ | Ast.TyExt(_loc, id, _param_list, type_def) -> ++ (* For wellformed input, id is just a lowercase ident. I make ++ * this work even if id is something else (and the input is invalid). ++ *) ++ write_tag (translate_loc (Ast.loc_of_ident id)) ++ (first_string_of_ident id); ++ tag_type write_tag type_def + | <:ctyp< $_t1$ == $t2$ >> -> + (* don't tag t1, its the abbreviation *) + tag_type write_tag t2 +@@ -113,6 +139,14 @@ let rec tag_type write_tag typ = match typ with + List.iter + (tag_record_label_decl write_tag) + (Ast.list_of_ctyp t []) ++ | Ast.TyAtt(_loc, _attr, _payload, t) -> ++ (* In 4.02 camlp4 does not parse item attributes "[@@foo]" that can be ++ * attachted to whole type definitions. In the future they may appear in ++ * t as TyAtt node wrapped around a variant type. Therefore I recurse ++ * here. In 4.02 t may contain a TyAtt, but only for type equations ++ * (type a = int [@foo]), for which recursion would not be necessary. ++ *) ++ tag_type write_tag t + + | <:ctyp< $tup:_$ >> (* tuple *) + | <:ctyp< [= $_$ ] >> (* exact variant type *) +@@ -134,6 +168,7 @@ let rec tag_type write_tag typ = match typ with + | <:ctyp< $_$ -> $_$ >> + | <:ctyp< $_$ $_$ >> (* type constructor application *) + | <:ctyp< $_$ as $_$ >> ++ | <:ctyp< .. >> (* empty extensible type *) + | <:ctyp< >> + -> () + +@@ -254,6 +289,12 @@ and tag_class_type write_tag = function + List.iter + (tag_class_sig_item write_tag) + (Ast.list_of_class_sig_item ci []) ++ | Ast.CtAtt(_loc, _attr, _payload, ct) -> ++ (* AFAICT there is no camlp4 grammar production constructing CtAtt. ++ * Nevertheless, I would expect CtAtt to be wrapped around class types as ++ * in "class ca = (object end : object end [@foo])", therefore I recurse. ++ *) ++ tag_class_type write_tag ct + + | <:class_type< $virtual:_$ $id:_$ [ $_$] >> + (* class id somewhere on the right hand side *) +@@ -330,7 +371,7 @@ let rec tag_sig_item write_tag sig_item = match sig_item with + (tag_module_sig_binding write_tag) + (Ast.list_of_module_binding mb []) + +- | <:sig_item< open $_$ >> ++ | Ast.SgOpn _ (* open x, open! x *) + | <:sig_item< include $_$ >> + -> () + +@@ -348,6 +389,7 @@ and tag_module_sig_binding write_tag mod_binding = match mod_binding with + *) + let wrong_id_loc = translate_loc (Ast.loc_of_module_binding mod_binding) in + write_tag (Reparse.loc_of_first_word wrong_id_loc) id; ++ + tag_module_type write_tag mtyp + + | <:module_binding< >> +@@ -372,10 +414,20 @@ and tag_module_type write_tag = function + List.iter + (tag_sig_item write_tag) + (Ast.list_of_sig_item sig_items []) ++ | Ast.MtAtt(_loc, _attr, _payload, mt) -> ++ (* AFAICT there is no camlp4 grammar production constructing MtAtt. ++ * Nevertheless, I would expect MtAtt to be wrapped around signature ++ * types as in "module type A = sig end [@foo]", therefore I recurse. ++ *) ++ tag_module_type write_tag mt + + | <:module_type< >> (* emty module type ast *) + | <:module_type< ' $_$ >> (* ??? MtQuo ??? *) + | <:module_type< module type of $_$ >> ++ | <:module_type< (module $id:_$) >> ++ (* module alias as module type; in 4.02 parsed in Camlp4 ++ * but not in OCaml; cannot be used in any way ++ *) + -> () + + | <:module_type< $anti:_$ >> (* anti quotations *) +@@ -487,6 +539,12 @@ and tag_class_expr write_tag = function + tag_class_expr write_tag ce; + (* ct can contain an object body, therefore tag it *) + tag_class_type write_tag ct ++ | Ast.CeAtt(_loc, _attr, _payload, ce) -> ++ (* AFAICT there is no camlp4 grammar production constructing CeAtt. ++ * Nevertheless, I would expect CeAtt to be wrapped around classes ++ * as in "class a = object end [@foo]", therefore I recurse. ++ *) ++ tag_class_expr write_tag ce + + | <:class_expr< $virtual:_$ $id:_$ [ $_$ ] >> + (* id on the right hand side -- ignore *) +@@ -559,6 +617,19 @@ let rec tag_let_pattern write_tag = function + ) + | <:patt< ($p1$ : $_$) >> -> + tag_let_pattern write_tag p1 ++ | Ast.PaAtt(_loc, _attr, _payload, p) -> ++ (* Attributes can be wrapped around patterns, ++ * eg "let x [@foo] = ..." ++ *) ++ tag_let_pattern write_tag p ++ | <:patt< exception $p$>> -> ++ (* Exception patterns are only permitted in proper matches with at ++ * least 2 cases and not in let bindings. However, camlp4 parses ++ * exception patterns in let bindings and only the type checker ++ * gives an error on them. Therefore, do something here on exceptions ++ * patterns. ++ *) ++ tag_let_pattern write_tag p + + | <:patt< $chr:_$ >> + | <:patt< $int:_$ >> +@@ -588,7 +659,7 @@ let rec tag_let_pattern write_tag = function + | <:patt< ( module $_$ ) >> (* package pattern not permitted in top-level *) + | <:patt< >> + -> assert false +- ++(* XXX (PaExc (_, _)) *) + + + let rec tag_str_item write_tag str_item = match str_item with +@@ -651,7 +722,7 @@ let rec tag_str_item write_tag str_item = match str_item with + (Ast.list_of_module_binding mb []) + + +- | <:str_item< open $_$ >> ++ | Ast.StOpn _ (* open x, open! x *) + | <:str_item< include $_$ >> + | <:str_item< $exp:_$ >> + | <:str_item< # $_$ $_$ >> (* directive *) +@@ -693,6 +764,12 @@ and tag_module_expr write_tag = function + List.iter + (tag_str_item write_tag) + (Ast.list_of_str_item str_items []) ++ | Ast.MeAtt(_loc, _attr, _payload, me) -> ++ (* AFAICT there is no camlp4 grammar production constructing MeAtt. ++ * Nevertheless, I would expect MeAtt to be wrapped around signature ++ * types as in "module A = struct end [@foo]", therefore I recurse. ++ *) ++ tag_module_expr write_tag me + + | <:module_expr< $_$ $_$ >> (* XXX check and probably tag this *) + | <:module_expr< $id:_$ >> +@@ -718,4 +795,3 @@ let generate_tags write_tag unit_ast = + (tag_str_item write_tag) + (Ast.list_of_str_item str_unit []) + ) +- diff --git a/debian/patches/0001-Set-required-version-to-4.02.patch b/debian/patches/0001-Set-required-version-to-4.02.patch deleted file mode 100644 index 6797ebf..0000000 --- a/debian/patches/0001-Set-required-version-to-4.02.patch +++ /dev/null @@ -1,22 +0,0 @@ -From: Mehdi Dogguy <me...@debian.org> -Date: Fri, 16 Oct 2015 23:03:47 +0200 -Subject: Set required version to 4.02 - ---- - configure | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure b/configure -index d0e1bd3..e9e0c60 100755 ---- a/configure -+++ b/configure -@@ -29,7 +29,7 @@ - - set -e - --REQUIRED_OCAML_VERSION=4.01 -+REQUIRED_OCAML_VERSION=4.02 - OTAGS_VERSION=1 - - root=/usr/local --- diff --git a/debian/patches/series b/debian/patches/series index 1f71c49..a06cc00 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1 @@ -0001-Set-required-version-to-4.02.patch +0001-Port-to-OCaml-4.02.3.patch -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ocaml-maint/packages/otags.git _______________________________________________ Pkg-ocaml-maint-commits mailing list Pkg-ocaml-maint-commits@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ocaml-maint-commits