diff options
author | Nicolas Pouillard <np@nicolaspouillard.fr> | 2010-05-11 14:54:35 +0000 |
---|---|---|
committer | Nicolas Pouillard <np@nicolaspouillard.fr> | 2010-05-11 14:54:35 +0000 |
commit | bf809e1ad113c40e5490252720a1e97274715b6d (patch) | |
tree | e3993e4bcc322457f452ee5fd80c1900801448a8 | |
parent | 03aaba0aae333793c06b50b3dc4684bd6a8dc152 (diff) | |
download | ocaml-bf809e1ad113c40e5490252720a1e97274715b6d.tar.gz |
camlp4: add support for record punning
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@10389 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | camlp4/Camlp4Parsers/Camlp4OCamlRevisedParser.ml | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/camlp4/Camlp4Parsers/Camlp4OCamlRevisedParser.ml b/camlp4/Camlp4Parsers/Camlp4OCamlRevisedParser.ml index b51c493244..fb7241a602 100644 --- a/camlp4/Camlp4Parsers/Camlp4OCamlRevisedParser.ml +++ b/camlp4/Camlp4Parsers/Camlp4OCamlRevisedParser.ml @@ -921,6 +921,12 @@ Very old (no more supported) syntax:\n\ | `ANTIQUOT ("list" as n) s -> <:patt< $anti:mk_anti ~c:"patt;" n s$ >> | i = label_longident; "="; p = patt -> <:patt< $i$ = $p$ >> + | i = label_longident -> + let rec desugar_punning = fun + [ <:ident< $_$ . $i$ >> -> desugar_punning i + | <:ident< $lid:lid$ >> -> <:patt< $i$ = $lid:lid$ >> + | _ -> assert False ] + in desugar_punning i ] ] ; ipatt: |