Skip to content
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

Merged
merged 2 commits into from Jan 14, 2022
Merged

Conversation

WalterBright
Copy link
Member

This particular message is commonly complained about as inadequate.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @WalterBright!

Bugzilla references

Your 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 locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#13459"

@WalterBright WalterBright force-pushed the semicolon branch 3 times, most recently from a336a7d to 570ef6d Compare December 24, 2021 06:39
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());
Copy link
Member

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).

Copy link
Contributor

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.

@schveiguy
Copy link
Member

Oooh nice! Thanks Walter.

@RazvanN7
Copy link
Contributor

@ibuclaw I have added the errorSupplemental. Is this good to go?

@ibuclaw
Copy link
Member

ibuclaw commented Jan 14, 2022

Let's just roll with it for now.

@dlang-bot dlang-bot merged commit 2b6ac27 into dlang:master Jan 14, 2022
@WalterBright WalterBright deleted the semicolon branch January 15, 2022 04:46
@adamdruppe
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants