|
Packit Service |
8bf002 |
/* n_24.t: # operator in macro definition. */
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
#define str( a) # a
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
/* 24.1: White spaces should not be inserted (silly specification). */
|
|
Packit Service |
8bf002 |
/* "a+b"; */
|
|
Packit Service |
8bf002 |
str( a+b);
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
/* 24.2: White spaces between tokens of operand are converted to one space.
|
|
Packit Service |
8bf002 |
*/
|
|
Packit Service |
8bf002 |
/* "ab + cd"; */
|
|
Packit Service |
8bf002 |
str( ab /* comment */ +
|
|
Packit Service |
8bf002 |
cd );
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
/* 24.3: \ is inserted before \ and " in or surrounding literals and no
|
|
Packit Service |
8bf002 |
other character is inserted to anywhere. */
|
|
Packit Service |
8bf002 |
/* "'\"' + \"' \\\"\""; */
|
|
Packit Service |
8bf002 |
str( '"' + "' \"");
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
/* 24.4: Line splicing by <backslash><newline> is done prior to token
|
|
Packit Service |
8bf002 |
parsing. */
|
|
Packit Service |
8bf002 |
/* "\"abc\""; */
|
|
Packit Service |
8bf002 |
str( "ab\
|
|
Packit Service |
8bf002 |
c");
|
|
Packit Service |
8bf002 |
|
|
Packit Service |
8bf002 |
/* 24.5: Token separator inserted by macro expansion should be removed.
|
|
Packit Service |
8bf002 |
(Meanwhile, tokens should not be merged. See 21.2.) */
|
|
Packit Service |
8bf002 |
#define xstr( a) str( a)
|
|
Packit Service |
8bf002 |
#define f(a) a
|
|
Packit Service |
8bf002 |
/* "x-y"; */
|
|
Packit Service |
8bf002 |
xstr( x-f(y));
|
|
Packit Service |
8bf002 |
|