mirror of
https://github.com/frida/tinycc
synced 2024-12-24 22:16:49 +03:00
Fix tokenization of TOK_DOTS
We really need to use PEEKC during tokenization so as to skip line continuations automatically.
This commit is contained in:
parent
f85db99ff0
commit
8fc5a6a2a4
12
tccpp.c
12
tccpp.c
@ -2553,9 +2553,15 @@ maybe_newline:
|
||||
} else if ((isidnum_table['.' - CH_EOF] & IS_ID) != 0) { /* asm mode */
|
||||
*--p = c = '.';
|
||||
goto parse_ident_fast;
|
||||
} else if (c == '.' && p[1] == '.') {
|
||||
p += 2;
|
||||
tok = TOK_DOTS;
|
||||
} else if (c == '.') {
|
||||
PEEKC(c, p);
|
||||
if (c == '.') {
|
||||
p++;
|
||||
tok = TOK_DOTS;
|
||||
} else {
|
||||
*--p = '.'; /* may underflow into file->unget[] */
|
||||
tok = '.';
|
||||
}
|
||||
} else {
|
||||
tok = '.';
|
||||
}
|
||||
|
@ -114,6 +114,11 @@ void num(int n);
|
||||
void forward_ref(void);
|
||||
int isid(int c);
|
||||
|
||||
/* Line joining happens before tokenization, so the following
|
||||
must be parsed as ellipsis. */
|
||||
void funny_line_continuation (int, ..\
|
||||
. );
|
||||
|
||||
#define A 2
|
||||
#define N 1234 + A
|
||||
#define pf printf
|
||||
|
Loading…
Reference in New Issue
Block a user