[wg-camlp4] Changes to the parsetree
Gerd Stolpmann
info at gerd-stolpmann.de
Thu Mar 28 16:13:36 GMT 2013
Am 25.03.2013 19:49:49 schrieb(en) Alain Frisch:
> On 03/25/2013 03:13 PM, jathdr wrote:
>> Could we get a summary of the current syntax proposal? I've been
>> following along, but I'm a bit lost as to what has been discussed,
>> accepted, rejected, etc.
>
> This file describes the current syntax proposal:
>
> http://caml.inria.fr/cgi-bin/viewvc.cgi/ocaml/branches/extension_points/experimental/frisch/extension_points.txt?revision=HEAD&view=markup
Two little comments:
- 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] ...) ?
(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?)
- 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.
>
>> This is probably a bit off topic, but while we're talking about
>> interval patterns: I discovered the other day that interval patterns
>> only work for chars, while I always assumed they also worked for
>> ints. Is there a reason why they don't?
>
> Currently, range patterns for characters are expanded in the parser.
> Doing so for integers as well could lead to huge or-patterns to be
> processed by the rest of the compiler. Supporting range patterns
> directly in the compiler would add a little bit of extra complexity
> for type-checking (exhaustiveness check) and code generation. I
> don't see any theoretical problem, though.
>
>
> -- Alain
> _______________________________________________
> wg-camlp4 mailing list
> wg-camlp4 at lists.ocaml.org
> http://lists.ocaml.org/listinfo/wg-camlp4
>
--
------------------------------------------------------------
Gerd Stolpmann, Darmstadt, Germany gerd at gerd-stolpmann.de
Creator of GODI and camlcity.org.
Contact details: http://www.camlcity.org/contact.html
Company homepage: http://www.gerd-stolpmann.de
------------------------------------------------------------
More information about the wg-camlp4
mailing list