Skip to content

feat: clear diagnostrics for unterminated strings - #646

Closed
DaanV2 wants to merge 3 commits into
Blockception:mainfrom
DaanV2:main
Closed

feat: clear diagnostrics for unterminated strings#646
DaanV2 wants to merge 3 commits into
Blockception:mainfrom
DaanV2:main

Conversation

@DaanV2

@DaanV2 DaanV2 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

No description provided.

DaanV2 and others added 3 commits July 22, 2026 12:55
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
@DaanV2 DaanV2 closed this by deleting the head repository Aug 5, 2026
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.

2 participants