feat(lexer): add comment scanning with @__PURE__ detection#4
Merged
Conversation
Comments: - Single-line comments (// ... \n) — skipped, not tokenized - Multi-line comments (/* ... */) — skipped, newlines tracked for line table - Comments return .undetermined → next() loops to scan actual token - U+2028/U+2029 as line terminators in single-line comments Pure comment detection (D025): - @__PURE__ in /* */ or // comments - #__PURE__ (webpack convention) - @__NO_SIDE_EFFECTS__ - Sets has_pure_comment_before flag on next token Tests: - Single-line comment skipping - Multi-line comment skipping - Multi-line comment with newline → has_newline_before - @__PURE__, #__PURE__, @__NO_SIDE_EFFECTS__ detection - Normal comment does not set pure flag - Comment at EOF - Comment-only source - Slash after comment not confused Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ohah
added a commit
that referenced
this pull request
Mar 21, 2026
플랜 PR #4 항목 5 구현: 예약어/글로벌 이름 충돌 체크. - isReservedName(): JS 예약어 41개 + 글로벌 객체 29개 - computeRenames에서 후보 이름이 예약어/글로벌이면 다음 번호로 건너뜀 - Rolldown renamer.rs와 동일 패턴 2개 유닛 테스트 (JS reserved words, global objects). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 tasks
ohah
added a commit
that referenced
this pull request
Mar 21, 2026
플랜 PR #4 항목 5 구현: 예약어/글로벌 이름 충돌 체크. - isReservedName(): JS 예약어 41개 + 글로벌 객체 29개 - computeRenames에서 후보 이름이 예약어/글로벌이면 다음 번호로 건너뜀 - Rolldown renamer.rs와 동일 패턴 2개 유닛 테스트 (JS reserved words, global objects). 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
//) and multi-line (/* */) comment scanningnext()loops via.undeterminedreturn@__PURE__,#__PURE__,@__NO_SIDE_EFFECTS__detection (D025)Test plan
zig build test통과 (55 tests)zig fmt --check src/통과🤖 Generated with Claude Code