This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
lexer should correctly create StringLiterals for following examples #define likely(x) (x) #define unlikely(x) (x) void ddd_assert_fail (const char *assertion, const char *file, unsigned int line, const char *function); #define _assert_fn "" #define assert(ex) \ _ASSERT_VOID_CAST(unlikely(ex) ? \ 0 : \ (ddd_assert_fail (#ex, __FILE__, __LINE__, _assert_fn), 0) \ ) void foo() { if ("1" "2" "3" != 0) { assert ( "1" "2" "3" != 0); } } Note: need to update StringLiteral rule like: StringLiteral : ( (options{warnWhenFollowAmbig = false; }: StringPart (options{warnWhenFollowAmbig = false; }: InterStringWhitespace )* )+ ) ; protected InterStringWhitespace : ( (' ' |'\t' | '\f') // handle newlines | ( { (LA(1) == '\r') && (LA(2) == '\n') }? "\r\n" // MS | '\r' // Mac | '\n' // Unix ) { newline(); } ) { $setType(Token.SKIP); } ; protected StringPart : '"' ( Escape | ( "\\\r\n" // MS | "\\\r" // MAC | "\\\n" // Unix ) {newline();} | ~('"' | '\r' | '\n' | '\\') )* '"' ; + need to handle correct creating of parameters in MacroExpander.addParam. string should be correctly concatenated. Is it possible to do on lexer level?
Integrated fixes. The problems like: if ("1" "2" "3" != 0) { } ddd_assert_fail("1\"1a""2" "3" "4" "5" "6", 0, 0, 0); where ddd_assert is name of function are solved; problems like assert ( "1" "2" "3" != 0); where assert is macro with params fixed with workaround. P.S. mark issue as started, not resolved, need to review of FIXUP
fixed in APT lexer