fix(tokenizer): reject non-ASCII entity names by jinchuntan · Pull Request #1093 · 8f4e/8f4e · GitHub
Skip to content

fix(tokenizer): reject non-ASCII entity names - #1093

Merged
andorthehood merged 1 commit into
8f4e:mainfrom
jinchuntan:fix/ascii-entity-names
Oct 20, 2026
Merged

andorthehood merged 1 commit into
8f4e:mainfrom
jinchuntan:fix/ascii-entity-names

Conversation

@jinchuntan

@jinchuntan jinchuntan commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1046.

Non-ASCII names now fail during tokenization with INVALID_IDENTIFIER and the source line before reaching Wasm emission. Valid ASCII punctuation, constant capitalization rules and quoted strings keep their existing behavior.

Tests cover accented names and emoji in declarations, references and compile time operands plus an ASCII program that validates and runs as WebAssembly. Also documents the naming restriction.

Validation on Node 24.16.0: 508 tokenizer tests and 333 compiler tests passed, along with both type checks, Biome and the pre-commit checks.

npx nx run-many --targets=test,typecheck --projects=@8f4e/tokenizer,@8f4e/compiler --parallel=1

@irimias57 irimias57 added contributor compiler Compiler, tokenizer, codegen, and language-semantics work labels Oct 18, 2026

@irimias57 irimias57 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the thorough fix, @jinchuntan! The shared ASCII check rejects accented and supplementary characters before WebAssembly emission while preserving Unicode string literals and the existing ASCII naming rules, and the tokenizer/compiler tests, type checks, and lint all pass against current main. If you would like another tokenizer issue, #1047 is currently unassigned and labeled help wanted.

@andorthehood andorthehood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again for the contribution!

@andorthehood
andorthehood merged commit af89166 into 8f4e:main Oct 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler Compiler, tokenizer, codegen, and language-semantics work contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reject non-ASCII entity names during tokenization

3 participants