diff --git a/camlp4/CHANGES b/camlp4/CHANGES index 38b268bdc..1ef216018 100644 --- a/camlp4/CHANGES +++ b/camlp4/CHANGES @@ -1,8 +1,8 @@ Camlp4 Version 3.04 ------------------- -- [15 Oct 01] Fixed parsing differences in parsers between pa_o and - ocamlyacc. +- [15 Oct 01] Fixed parsing differences between pa_o and ocamlyacc: + in parsers, in labels. - [12 Oct 01] Added missing bigarray syntax a.{b} (and Cie) in standard syntax (pa_o). diff --git a/camlp4/etc/pa_o.ml b/camlp4/etc/pa_o.ml index 33c5940bf..c058c0f6b 100644 --- a/camlp4/etc/pa_o.ml +++ b/camlp4/etc/pa_o.ml @@ -1156,6 +1156,8 @@ EXTEND <:patt< ~ $i$ : $p$ >> | i = TILDEIDENT -> <:patt< ~ $i$ >> + | "~"; "("; i = LIDENT; ")" -> + <:patt< ~ $i$ >> | "~"; "("; i = LIDENT; ":"; t = ctyp; ")" -> <:patt< ~ $i$ : ($lid:i$ : $t$) >> | i = QUESTIONIDENTCOLON; j = LIDENT -> diff --git a/camlp4/etc/pr_r.ml b/camlp4/etc/pr_r.ml index 7ec8b15b7..fa73039ad 100644 --- a/camlp4/etc/pr_r.ml +++ b/camlp4/etc/pr_r.ml @@ -745,7 +745,7 @@ and fun_binding b fb k = | e -> HVbox [: `HVbox [: b; `S LR "=" :]; `expr e k :] ] and simple_patt p k = match p with - [ <:patt< $lid:_$ >> -> patt p k + [ <:patt< $lid:_$ >> | <:patt< ~ $_$ : $_$ >> | <:patt< ~ $_$ >> -> patt p k | _ -> HVbox [: `S LO "("; `patt p [: `S RO ")"; k :] :] ] and class_type ct k = match ct with