File: n_24.t

package info (click to toggle)
mcpp 2.7.2-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 8,152 kB
  • ctags: 29,136
  • sloc: ansic: 35,238; sh: 9,241; makefile: 176; cpp: 84; exp: 18
file content (32 lines) | stat: -rw-r--r-- 878 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* n_24.t:  # operator in macro definition. */

#define str( a)     # a

/* 24.1:    White spaces should not be inserted (silly specification).  */
/*  "a+b";  */
    str( a+b);

/* 24.2:    White spaces between tokens of operand are converted to one space.
 */
/*  "ab + cd";  */
    str(    ab  /* comment */   +
        cd  );

/* 24.3:    \ is inserted before \ and " in or surrounding literals and no
        other character is inserted to anywhere.    */
/*  "'\"' + \"' \\\"\"";    */
    str( '"' + "' \"");

/* 24.4:    Line splicing by <backslash><newline> is done prior to token
        parsing.   */
/*  "\"abc\"";  */
    str( "ab\
c");

/* 24.5:    Token separator inserted by macro expansion should be removed.
        (Meanwhile, tokens should not be merged.  See 21.2.)    */
#define xstr( a)    str( a)
#define f(a)        a
/*  "x-y";  */
    xstr( x-f(y));