Skip to content

Parser: Re-parse on unexpected ";" error for more accurate errors#902

Merged
marcoroth merged 4 commits into
mainfrom
parser-reparse-on-semicolon-error
Nov 18, 2025
Merged

Parser: Re-parse on unexpected ";" error for more accurate errors#902
marcoroth merged 4 commits into
mainfrom
parser-reparse-on-semicolon-error

Conversation

@marcoroth

@marcoroth marcoroth commented Nov 18, 2025

Copy link
Copy Markdown
Owner

This pull request changes the way the parser handles the unexpected ";" errors.

In #824, we changed the herb_extract_ruby_to_buffer_with_semicolons method to only add semicolons when needed. This pull request reverts that. But instead of just outputting the unexpected ";" errors (as it was before #824), we check if the ; was actually part of the source file.

If it wasn't part of the source file we re-parse this individual ERBContentNode to check for syntax errors in the raw source of that ERBContentNode instead, which shouldn't have the semicolon and thus shouldn't append the unexpected ";" errors.

Resolves #854
Resolves #865
Resolves #899

@pkg-pr-new

pkg-pr-new Bot commented Nov 18, 2025

Copy link
Copy Markdown
npx https://pkg.pr.new/@herb-tools/formatter@902
npx https://pkg.pr.new/@herb-tools/language-server@902
npx https://pkg.pr.new/@herb-tools/linter@902

commit: 7eba55b

@github-actions

github-actions Bot commented Nov 18, 2025

Copy link
Copy Markdown

🌿 Interactive Playground and Documentation Preview

A preview deployment has been built for this pull request. Try out the changes live in the interactive playground:


🌱 Grown from commit 7eba55b


✅ Preview deployment has been cleaned up.

@marcoroth marcoroth merged commit 7c07d9d into main Nov 18, 2025
32 checks passed
@marcoroth marcoroth deleted the parser-reparse-on-semicolon-error branch November 18, 2025 15:46
@tk0miya

tk0miya commented Nov 30, 2025

Copy link
Copy Markdown
Contributor

@marcoroth do you have a plan for a new release including this? I've still used v0.7 because of this bug. It would be very helpful if 0.8.3 released.
Thank you for your work :-)

@marcoroth

Copy link
Copy Markdown
Owner Author

Hey @tk0miya, sorry for the delay. I just got back home from the San Francisco Ruby Conference. I'm planning on releasing a new Herb version later today! 🙌🏼

@tk0miya

tk0miya commented Dec 1, 2025

Copy link
Copy Markdown
Contributor

Oh, I don't know that. I'm not in a hurry, so please work on it at your own leisure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants