ocaml/camlp4 — pull request #11 by gasche (2014-02-05 14:27:11+00:00)
Title: support for M.[ foo ], M.{ foo }, etc.

This is a proposal implementation of the approach suggested by Jérémie
in github issue #10. I had to protect the expr production

| m = a_UIDENT; "."; l = SELF -> <:ident< $uid:m$.$l$ >>

with a TRY around [ "."; SELF ], because otherwise it would fire
in the M. case, eat the last dot, and then fail with a parse
error on the delimiter.

PS: take this code with a grain of salt. I compiled and (lightly) tested it in the ocaml 4.00 branch (I haven't done the not-totally-obvious work of getting separate-camlp4 to compile on my machine yet). And camlp4 parsing is always very tricky. It's more meant for review and inspiration than for actual inclusion.