Files
ww/cmd/w6a/lex.c
Hojun-Cho 62b9d20383 toolchain: banner purge + WHY-only comment sweep (rule 8)
selfhost/, cmd/, internal/ join the tree-wide sweep: every section
banner dies (91 selfhost + the cmd C-style dividers -> 0); narration
and stale contracts deleted (pre-#22 bundler notes, retired
single-PT_LOAD and no-archive claims, superseded ABI tables); every
ref/harec/qbe cite, task cite, encoding/ELF contract, and rule-10
twin pointer kept; lost lifetime/rationale lines restored where the
sweep over-cut (elf_globals ownership, kwtab linear-scan). Comment-
only proven: all five wwstage tool binaries byte-identical across
the sweep; test-commit, test-byteid (161+1399, 0 pinned-divergent),
and test-bootstrap (fixed point + 991-995 byte-id) all exit 0.
The read-through banked 66 latent-bug leads (checkpoint).
2026-08-08 23:14:03 +09:00

27 lines
587 B
C

#include "a.h"
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
int
a_isidstart(int c)
{
return c == '_' || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z');
}
int
a_isidcont(int c)
{
return a_isidstart(c) || (c >= '0' && c <= '9') || c == '.';
}
i64
a_parsenum(const char *s, char **end)
{
/* Let strtoll handle the sign itself: hand-stripping '-' then
* negating the result fails for LLONG_MIN because the positive
* magnitude (2^63) doesn't fit in long long, strtoll clamps to
* LLONG_MAX, and the negation lands one short. */
return (i64)strtoll(s, end, 0);
}