Skip to content

fix: report unfinished concise constructs at EOF - #268

Merged
DylanPiercey merged 1 commit into
mainfrom
dpiercey-w2-htmljs-rust-4t8x5b
Nov 13, 2026
Merged

DylanPiercey merged 1 commit into
mainfrom
dpiercey-w2-htmljs-rust-4t8x5b

Conversation

@DylanPiercey

Copy link
Copy Markdown
Contributor

In concise mode an unclosed (, {, <, |, $ { or ${ at EOF was accepted silently: no error, and the event claimed a closer past the end of the input (foo onclick(e, foo(e, $ { x; foo${x emitted nothing at all). Expressions that a closer ends now reach the EOF error, as they already did in html mode. That error now names what was being parsed ("attribute arguments for the "onclick" attribute", "tag parameters for the "foo" tag", …) instead of always saying "attribute value" or "attribute name", and an <!---> comment's value is an empty range rather than an inverted one.

It also adds tests that would have caught these: every fixture also runs with CRLF line endings, every prefix of every fixture (an EOF at each position) must report only in-range, non-inverted ranges, and new fixtures cover multibyte input, which none did before.

🤖 Generated with Claude Code

@changeset-bot

changeset-bot Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 378a378

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
htmljs-parser Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

In concise mode EOF ended any expression without an error, so an unclosed
`(…`, `{…`, `<…`, `|…`, `$ {…` or `${…` was accepted and reported with a
range claiming a closer past the end of the input. Expressions a closer
ends now reach the EOF error, as in html mode, and that error names what
was being parsed. An `<!--->` comment's value is an empty range, not an
inverted one.

Tests that would have caught these: every fixture also runs with CRLF line
endings, every prefix of every fixture (an EOF at each position) must report
only in-range, non-inverted ranges, and new fixtures cover multibyte input.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DylanPiercey
DylanPiercey force-pushed the dpiercey-w2-htmljs-rust-4t8x5b branch from aca03ee to 378a378 Compare November 13, 2026 22:36
@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown

Explain Change →

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@codecov

codecov Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.89%. Comparing base (8955da9) to head (378a378).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #268   +/-   ##
=======================================
  Coverage   99.89%   99.89%           
=======================================
  Files          35       35           
  Lines        4930     4990   +60     
  Branches      971      986   +15     
=======================================
+ Hits         4925     4985   +60     
- Misses          4        5    +1     
+ Partials        1        0    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DylanPiercey
DylanPiercey merged commit f87a4c5 into main Nov 13, 2026
9 of 11 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 13, 2026
@github-project-automation github-project-automation Bot moved this to Done in Roadmap Nov 30, 2026
@DylanPiercey DylanPiercey self-assigned this Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant