[wg-camlp4] Changes to the parsetree

Alain Frisch alain.frisch at lexifi.com
Thu Mar 28 21:54:09 GMT 2013


On 3/28/2013 5:13 PM, Gerd Stolpmann wrote:
>   - So far, a begin/end pair can always be replaced by normal parentheses.
>     The "keyword" rules do not allow it so far - when we have
>     begin [@foo] ... end, why not also allow ([@foo] ...) ?

This (and also (%foo ...)) used to be recognized, but there has been 
some resistance to it.  I don't have a strong opinion on this topic and 
it will always be possible to add more syntax if the current one turns 
out to be inconvenient in some cases.

>     (Currently, it's even possible to use begin/end and parentheses
>     in a mixed way, like ( ... end - maybe also get rid of this
>     asymmetry, as we are at syntax?)

I don't think that this mixed syntax is actually accepted.


>   - Am I right that we get a new form of commenting out code blocks?
>
>     (* {ignore| commented out text can almost contain anything |ignore} *)
>
>     That would be helpful to comment out blocks that violate the lexing
>     rules.

It is not currently supported in the branch (quoted strings are not 
recognized within comments), but this is a bug.  You're right that it 
will allow to embed non-lexable data (even binary, if you wish) in comments.

-- Alain


More information about the wg-camlp4 mailing list