fix(lexer): normalize narrow literals to UTF-8 execution bytes - #76
gengjiawen wants to merge 3 commits into
Conversation
Co-authored-by: Codex (gpt-6-astra) <noreply@openai.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: Codex (gpt-6-astra) <noreply@openai.com>
|
Holding this one for your call — the other 45 audit PRs (#41–#88) are merged; this is the only one left. The change is technically right: a narrow string literal is a byte sequence in the execution character set, so parse('char *s = "café";') // value was 'café', becomes 'café' (UTF-8 bytes as code units)That is a visible regression for the primary consumer (AST Explorer renders Verified: the change combines cleanly with everything now on |
Raw non-ASCII text and universal escapes produced different narrow literal values. Encode both as UTF-8 execution bytes, keep numeric byte escapes distinct, consume astral characters as complete code points, and apply the same contract to macro-created string literals.
Validation: equivalent-spelling and multibyte-character regressions, macro stringification, lint, formatting, typecheck, build and all tests.
Mixed narrow/wide concatenation re-lexes each narrow spelling using the final prefix, preserving the difference between byte escapes and Unicode text; incompatible wide encodings receive a diagnostic.