DMD 1.021 and 2.004 releases

Jari-Matti Mäkelä jmjmak at utu.fi.invalid
Tue Sep 11 11:42:53 PDT 2007


Jascha Wetzel wrote:

> before, the lexical structure was context free because of nested
> comments and floats of the form "[0-9]+\.". the latter can be matched
> with regexps if they support lookaheads, though.

Nested comments don't necessarily need much more than a constant size
counter, either.

> if you stick to the specs verbatim, q"EOS...EOS" as a whole is a string
> literal. assuming that all tokens/lexemes are atomic, a lexer can't
> "look inside" the string literal. from that point of view, the lexical
> structure it's still context free.

But does a simple tool have to be so complex?

> if possible, i'd add a thin wrapper around an automatically generated
> lexer that checks the delimiters in a postprocess.

That's a bit harder with e.g. closed source tools.


Btw, is this a bug?

auto foo = q"EOS
EOS
EOS";

doesn't compile with dmd 2.004. Or is the " always supposed to follow \n +
matching identifier?



More information about the Digitalmars-d-announce mailing list