New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve ; expected error message #13459
Conversation
Thanks for your pull request, @WalterBright! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#13459" |
a336a7d
to
570ef6d
Compare
src/dmd/parse.d
Outdated
@@ -5018,7 +5018,10 @@ class Parser(AST) : Lexer | |||
continue; | |||
|
|||
default: | |||
error("semicolon expected, not `%s`", token.toChars()); | |||
if (loc.linnum != token.loc.linnum) | |||
error("semicolon needed to end declaration of `%s` begun on line %d, instead of `%s`", v.toChars(), loc.linnum, token.toChars()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an errorSupplemental (when verrors=context?) because having line information packed into an error is just awkward when you instead could have a new error line saying that the statement began here (with context).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ping @WalterBright ! We should really try to get this in.
Oooh nice! Thanks Walter. |
@ibuclaw I have added the errorSupplemental. Is this good to go? |
Let's just roll with it for now. |
This particular message is commonly complained about as inadequate.