[wg-camlp4] A new branch to experiment with extension points

Pierre Chambart pierre.chambart at crans.org
Fri Mar 1 15:17:54 GMT 2013


Le Fri, 1 Mar 2013 14:40:22 +0100,
Gabriel Scherer <gabriel.scherer at gmail.com> a écrit :

> I'm not fond of having "with" as a special case. If you don't support
> the type-conv or deriving syntax as is, could we take this as an
> opportunity to go back to an uniform syntax? Type declaration could be
> handled like any structure item.
> 
> Don't we want to have attributes on signature items as well?
> 
> Finally, I bet the non-terminal ".." will get little love, but I'm
> sure you considered other option (for example just ;;(:foo), but that
> doesn't work in the toplevel and we really want ";;" to help *avoid*
> precedence issues) and trust that this is one of the less ugly ones.
> 
> Is that proposal sufficient to do ocamldoc with structured attributes
> rather than comments? It looks like it is. Can an annotation node, by
> itself, stand as a structure item (I'm thinking section comments)?

I think that ocamldoc like things would need the 'any string' kind of
attribute that was discused in previous threads. I imagine that this
will need some clever lexing tricks to find a start delimiter that is
not currently accepted and seems nice. Since I a very bad at choosing
syntax what I will propose will be ugly:

something like

(:#DELIM#ident the real stringDELIM) and
(&#DELIM#ident the real stringDELIM)

maybe it the string does not contains # and ) we could also allow
(:#ident the real string)
(&#ident the real string)

Feel free to find that awfull and have any proposition that will
necessarily be better...

By the way I like the overall proposition. Go on Alain !
-- 
Pierre
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.ocaml.org/pipermail/wg-camlp4/attachments/20130301/f55c5981/attachment.sig>


More information about the wg-camlp4 mailing list