diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-08-29 22:55:38 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-08-29 22:55:38 +0900 |
| commit | 1c2effbc0d2922f92cb8187c4252c0554718d546 (patch) | |
| tree | 81e7373e9eeeebfa58c42b74b545959f8c7059b4 /src/preprocess.c | |
| parent | 51ddd0e8d62ba456688b1ab2d907f7ad3fbd827d (diff) | |
| download | ducc-1c2effbc0d2922f92cb8187c4252c0554718d546.tar.gz ducc-1c2effbc0d2922f92cb8187c4252c0554718d546.tar.zst ducc-1c2effbc0d2922f92cb8187c4252c0554718d546.zip | |
feat: tokenize integer suffix
Diffstat (limited to 'src/preprocess.c')
| -rw-r--r-- | src/preprocess.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/preprocess.c b/src/preprocess.c index 318e7fc..788be1a 100644 --- a/src/preprocess.c +++ b/src/preprocess.c @@ -477,6 +477,10 @@ static void pplexer_tokenize_all(PpLexer* ppl) { strbuilder_append_char(&builder, infile_peek_char(ppl->src)); infile_next_char(ppl->src); } + // Skip integer suffix. + while (isalpha(infile_peek_char(ppl->src))) { + infile_next_char(ppl->src); + } tok->kind = TokenKind_literal_int; tok->value.integer = atoi(builder.buf); } else if (isalpha(c) || c == '_') { |
