Merged
Conversation
New file: src/lexer/unicode.zig
- decodeUtf8(): UTF-8 byte sequence → codepoint decoder
- isIdentifierStart(): Unicode ID_Start + $ + _
- isIdentifierContinue(): Unicode ID_Continue + ZWNJ + ZWJ
- Simplified Unicode range tables (Latin, Greek, Cyrillic, CJK, Hangul, etc.)
Scanner changes:
- scanIdentifierTail() now handles multi-byte UTF-8 identifiers
- scanIdentifierEscape() for \uXXXX and \u{XXXX} in identifiers
- Non-ASCII bytes in next() trigger unicode identifier path
- \u escape at identifier start → escaped_keyword token
- ASCII fast path preserved for performance
Tests: 11 new tests (7 unicode.zig + 4 scanner unicode identifier)
- UTF-8 decoding (1/2/3/4 byte)
- Unicode identifier detection (Latin, CJK, Hangul, Greek, Cyrillic)
- Scanner: café, 변수, α, mixed ASCII+CJK identifiers
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
unicode.zig: UTF-8 디코딩 + Unicode ID_Start/ID_Continue 판별\uXXXX,\u{XXXX}이스케이프 시퀀스 처리Test plan
zig build test통과 (102 tests)🤖 Generated with Claude Code