refactor(parser): split Context from u32 to u8#170
Merged
ohah merged 2 commits intofeature/context-move-unused-flagsfrom Mar 20, 2026
Merged
refactor(parser): split Context from u32 to u8#170ohah merged 2 commits intofeature/context-move-unused-flagsfrom
ohah merged 2 commits intofeature/context-move-unused-flagsfrom
Conversation
Context를 packed struct(u32) → packed struct(u8)로 축소. ECMAScript 문법 파라미터 8개만 Context에 유지: allow_in, in_generator, in_async, in_function, is_top_level, in_decorator, in_ambient, disallow_conditional_types 나머지 11개 플래그를 Parser struct 개별 필드로 이동: is_strict_mode, in_loop, in_switch, has_simple_params, for_loop_init, in_class, in_class_field, in_static_block, has_super_class, allow_super_call, allow_super_property SavedState struct 추가: 함수 진입 시 Context + Parser 필드를 함께 save/restore. enterFunctionContext/restoreFunctionContext 패턴. Test262 98.0% (470건 실패) — regression 없음. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- SavedState에 for_loop_init 추가 + 함수 경계에서 리셋 (중첩 함수가 외부 for_loop_init을 상속하는 버그 방지) - enterFunctionContext에서 has_simple_params를 true로 리셋 (다른 필드와 일관성 유지, 기본값 보장) - 미사용 in_static_block 필드 제거 - parseSwitchStatement에서 restoreContext 헬퍼 사용으로 일관성 확보 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
packed struct(u32)→packed struct(u8)로 축소 (문법 파라미터 8개만)SavedStatestruct +enterFunctionContext/restoreFunctionContext패턴 도입self.ctx.X→self.X참조 수정Test plan
zig build test통과zig build빌드 통과zig build test262-run98.0% (470건) — regression 없음🤖 Generated with Claude Code