Skip to content

feat(parser): yield/await contextual keyword validation#101

Merged
ohah merged 2 commits intomainfrom
feat/yield-await-validation
Mar 19, 2026
Merged

feat(parser): yield/await contextual keyword validation#101
ohah merged 2 commits intomainfrom
feat/yield-await-validation

Conversation

@ohah
Copy link
Copy Markdown
Owner

@ohah ohah commented Mar 19, 2026

Summary

  • yield는 generator 안에서만 yield_expression, 밖에서는 식별자로 파싱
  • await는 async/module mode에서만 await_expression, 그 외에서는 식별자
  • strict mode에서 yield 바인딩/레이블/식별자 사용 에러
  • module mode에서 await 바인딩/레이블/식별자 사용 에러
  • checkKeywordBinding, label 검증, parsePrimaryExpression 모두 통일

Test plan

  • zig build test 전체 통과
  • zig build 성공
  • Test262: 20082 → 20134 (+52건, 85.9% → 86.1%)

🤖 Generated with Claude Code

ohah and others added 2 commits March 19, 2026 18:14
ECMAScript 12.1.1 / 13.1.1 구현:
- yield는 generator 안에서만 yield_expression, 밖에서는 식별자로 파싱
- await는 async 안 또는 module mode(top-level await)에서만 await_expression
- strict mode에서 yield 바인딩/레이블/식별자 사용 금지
- module mode에서 await 바인딩/레이블/식별자 사용 금지
- checkKeywordBinding, label 검증, parsePrimaryExpression 모두 통일

Test262: 20082 → 20134 (+52건, 85.9% → 86.1%)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
yield/await 검증 로직 3곳 중복 → checkYieldAwaitUse(span, comptime context_noun) 헬퍼로 통일.
comptime 문자열 연결로 에러 메시지 자동 생성: "'yield' cannot be used as {identifier|label} in {context}".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ohah ohah merged commit df0c9b4 into main Mar 19, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant