mirror of https://github.com/rui314/chibicc
Recognize wide character literal
For now, L'' is equivalent to ''.
This commit is contained in:
parent
5baa7091f2
commit
ebf7b402ea
|
@ -95,6 +95,9 @@ int main() {
|
|||
of(char), \
|
||||
"sizeof(char)");
|
||||
|
||||
ASSERT(4, sizeof(L'\0'));
|
||||
ASSERT(97, L'a');
|
||||
|
||||
printf("OK\n");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -432,6 +432,13 @@ Token *tokenize(File *file) {
|
|||
continue;
|
||||
}
|
||||
|
||||
// Wide character literal
|
||||
if (startswith(p, "L'")) {
|
||||
cur = read_char_literal(cur, p + 1);
|
||||
p += cur->len + 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Identifier or keyword
|
||||
if (is_ident1(*p)) {
|
||||
char *q = p++;
|
||||
|
|
Loading…
Reference in New Issue