feat: clear diagnostrics for unterminated strings - #646
Closed
DaanV2 wants to merge 3 commits into
Closed
Conversation
The tokenizer threw a plain Error for unterminated string literals and unexpected characters. These bypassed the MolangSyntaxError handling in the diagnoser and fell through to the "unknown error was thrown during parsing of molang" branch, which surfaced a raw stack trace to the user. Throw MolangSyntaxError instead so the diagnoser emits an actionable message pointing at the missing quotation mark, with a proper error code and source position. Fixes #621 Claude-Session: https://claude.ai/code/session_01R7TyhiGbYgxAizqPxp53sq Co-authored-by: Claude <noreply@anthropic.com>
The tokenizer threw a plain Error for unterminated string literals and unexpected characters. These bypassed the MolangSyntaxError handling in the diagnoser and fell through to the "unknown error was thrown during parsing of molang" branch, which surfaced a raw stack trace to the user. Throw MolangSyntaxError with plain-language, human-friendly messages instead. The unterminated-string error names the quote style, shows a short preview of the offending text, and tells the user exactly what to add; the unexpected-character error hints at the likely cause. The editor already highlights the location, so raw character offsets are dropped from the wording. Fixes #621 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R7TyhiGbYgxAizqPxp53sq
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.
No description provided.