diff --git a/test/literal.c b/test/literal.c index c0fa499..472b72d 100644 --- a/test/literal.c +++ b/test/literal.c @@ -95,6 +95,9 @@ int main() { of(char), \ "sizeof(char)"); + ASSERT(4, sizeof(L'\0')); + ASSERT(97, L'a'); + printf("OK\n"); return 0; } diff --git a/tokenize.c b/tokenize.c index dd8d50c..760235b 100644 --- a/tokenize.c +++ b/tokenize.c @@ -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++;