fix(parser): 삼항 연산자 + 화살표 expression body 파싱 (#446)#449
Merged
Conversation
`a ? v => (expr) : v => (expr2)` 에서 화살표 expression body 안의 `(expr)` 뒤 `:` 를 TS typed arrow의 return type annotation으로 오인. 원인: enterFunctionContext가 in_ternary_consequent를 false로 리셋하여, 화살표 expression body에서 외부 삼항의 `:` 컨텍스트가 유실됨. 수정: parseArrowBody에서 expression body일 때 in_ternary_consequent를 외부 값으로 복원. d3-array의 cumsum 함수 파싱 에러 해결. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Benchmark Results (CI)macos-latesttranspile — small (100 lines)
transpile — medium (1K lines)
transpile — large (5K lines)
bundle — small (10 modules)
bundle — medium (50 modules)
bundle — large (200 modules)
ubuntu-latesttranspile — small (100 lines)
transpile — medium (1K lines)
transpile — large (5K lines)
bundle — small (10 modules)
bundle — medium (50 modules)
bundle — large (200 modules)
windows-latesttranspile — small (100 lines)
transpile — medium (1K lines)
transpile — large (5K lines)
bundle — small (10 modules)
bundle — medium (50 modules)
bundle — large (200 modules)
|
Smoke Test Results (CI)Smoke Test Results
Size Comparison (ZTS vs esbuild)
Average ratio: 1.19x | Smaller: 114 | Similar(±10%): 2 | Larger: 10
|
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
`a ? v => (expr) : v => (expr2)` 에서 화살표 expression body 뒤의 `:`를 TS typed arrow return type으로 오인하는 파서 버그 수정.
근본 원인
`enterFunctionContext`가 `in_ternary_consequent`를 false로 리셋하여, 화살표 expression body에서 외부 삼항의 `:` 컨텍스트가 유실.
수정
`parseArrowBody`에서 expression body일 때 `in_ternary_consequent`를 외부 값으로 복원.
Test plan
🤖 Generated with Claude Code