From: Cyrill G. <gor...@gm...> - 2011-04-13 21:08:13
|
Hi Peter after reading some pasting tokens code history I think we need to put a stone in and make a hard rule on how tokens might be joined and re-tokenized then. Single Macro expansion ---------------------- The current rule is (TOK_ID | TOK_PREPROC_ID) + (TOK_ID | TOK_PREPROC_ID | TOK_NUMBER) but it doesn't cover the case if FLOAT is needed. For anothe example the following code will not work %define tail(a) 0xa %define head(b) tail(b) because parser will treat 0xa as a number, and only explicit concat will help, ie the usage of %+ token. Multiline Macro expansion ------------------------- (TOK_ID | TOK_FLOAT) + (TOK_ID | TOK_NUMBER | TOK_FLOAT | TOK_OTHER) or/and (TOK_NUMBER) + (TOK_NUMBER) any of there combination will be concat'ed, but still TOK_NUMBER + TOK_FLOAT is not covered here. The bug in bugzilla happened to hit exactly the case where TOK_NUMBER + TOK_FLOAT is needed. So I thought just to add (TOK_NUMBER | TOK_FLOAT) + (TOK_NUMBER | TOK_FLOAT) in both cases but I fear this is too much. We definitely have to put a point somewhere. For example C requires explicit sign for concat'ing preproc tokens. Should we insist to simply use %+ if user need concat? We could leave (PREPROC_ID | ID | NUMBER) + (PREPROC_ID | ID | NUMBER) implicits in 2.10, dropping all others, for 2.09 I may try to restore old behaviour and fix the bug in bugzilla, but definitely it become messy otherwise. Thoughts? P.S. the bug I'm talking about is bug http://sourceforge.net/tracker/?func=detail&aid=3152189&group_id=6208&atid=106208 -- Cyrill |