We really need to use PEEKC during tokenization so as to skip line continuations automatically.
Unified · Split
| @@ -2553,9 +2553,15 @@ maybe_newline: · 2552 unmodified lines | |||
| 2553 | } else if ((isidnum_table['.' - CH_EOF] & IS_ID) != 0) { /* asm mode */ | 2553 | } else if ((isidnum_table['.' - CH_EOF] & IS_ID) != 0) { /* asm mode */ |
| 2554 | *--p = c = '.'; | 2554 | *--p = c = '.'; |
| 2555 | goto parse_ident_fast; | 2555 | goto parse_ident_fast; |
| 2556 | } else if (c == '.' && p[1] == '.') { | 2556 | } else if (c == '.') { |
| 2557 | p += 2; | 2557 | PEEKC(c, p); |
| 2558 | tok = TOK_DOTS; | 2558 | if (c == '.') { |
| 2559 | p++; | ||
| 2560 | tok = TOK_DOTS; | ||
| 2561 | } else { | ||
| 2562 | *--p = '.'; /* may underflow into file->unget[] */ | ||
| 2563 | tok = '.'; | ||
| 2564 | } | ||
| 2559 | } else { | 2565 | } else { |
| 2560 | tok = '.'; | 2566 | tok = '.'; |
| 2561 | } | 2567 | } |
| @@ -114,6 +114,11 @@ void num(int n); · 113 unmodified lines | |||
| 114 | void forward_ref(void); | 114 | void forward_ref(void); |
| 115 | int isid(int c); | 115 | int isid(int c); |
| 116 | 116 | ||
| 117 | /* Line joining happens before tokenization, so the following | ||
| 118 | must be parsed as ellipsis. */ | ||
| 119 | void funny_line_continuation (int, ..\ | ||
| 120 | . ); | ||
| 121 | |||
| 117 | #define A 2 | 122 | #define A 2 |
| 118 | #define N 1234 + A | 123 | #define N 1234 + A |
| 119 | #define pf printf | 124 | #define pf printf |