On Dec 27, 2007, at 12:11 PM, Chris Lattner wrote: >> (Why is it a good idea to treat stuff like @try as two tokens >> instead of one?) > > The answer is that thing like @ /*comment*/ try are legal, sadly > enough. However, it seems that we could probably do something in > the lexer (when it sees the "@", to handle this. I'll see what I > can do about this when I have time.
Okay, so it's quite possible to hack the lexer to merge these into two tokens. The problem with this is that it would lose the location info of the two pieces. I'd prefer to keep the lexer pure, and have it return perfect location info. This allows the client (eventually sema in this case) throw away loc info it doesn't need, but allows other clients to use it (e.g. -E mode). This means we're stuck with the parser having to handle these as two tokens, sorry. -Chris _______________________________________________ cfe-dev mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
