Skip to content

Enforce embedded TokenReader boundaries - #482

Open
Sylvester Kaczmarek (sylvesterkaczmarek) wants to merge 1 commit into
microsoft:mainfrom
sylvesterkaczmarek:fix/481-token-reader-subrange-bounds
Open

Enforce embedded TokenReader boundaries#482
Sylvester Kaczmarek (sylvesterkaczmarek) wants to merge 1 commit into
microsoft:mainfrom
sylvesterkaczmarek:fix/481-token-reader-subrange-bounds

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Fixes #481.

Enforce the embedded reader's start/end boundaries when peeking and backtracking. peekToken() now throws a clear error at an exhausted embedded range; a normal reader still exposes its existing EndOfInput token. Invalid backtracking leaves the reader state unchanged.

Adds nine focused regressions and a patch changelog entry. Seven regressions fail with the original reader.

Validation on macOS arm64 with Node 24:

  • All 264 parser tests pass; the complete rush test monorepo build/test command passes.
  • Both API demos and the built playground's Chromium smoke test pass.
  • Repository formatting, changelog verification, and whitespace checks pass.

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.

TokenReader subrange bounds enforced inconsistently: peekToken/peekPreviousTokenKind/backtrackToMarker ignore embedded window

1 participant