std.d.lexer requirements

Jonathan M Davis jmdavisProg at gmx.com
Thu Aug 2 22:38:42 PDT 2012


On Friday, August 03, 2012 07:30:32 Philippe Sigaud wrote:
> Look, many of us here were interested in your idea of having comments
> and errors lexed as tokens.
> Could it be possible to just add two static policies errorBehavior {
> report, skip, ...} and comments { asToken, grouped }?
> That way, a user just say;
> 
> // Walter
> auto toks = Lexer!(comments.grouped)(code); // May be the default value
> // Other:
> auto toks = Lexer!(comments.asToken)(code);
> 
> It's just a small static if away...

I'm sure it's possible. I just don't know how messy it will be. It depends on 
how the code is affected by needing to not treat comments and errors as tokens 
for what Walter wants. I'll see what I can do though.

- Jonathan M Davis


More information about the Digitalmars-d mailing list