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

fix issue 7184 - parse error on *(x)++ #8218

Closed
wants to merge 3 commits into from

Conversation

arBmind
Copy link
Contributor

@arBmind arBmind commented May 5, 2018

  • reduced parser to the specified grammar

see #7281 and #7442 for reference as well

* reduced parser to the specified grammar
@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @arBmind! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the annotated coverage diff directly on GitHub with CodeCov's browser extension
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Auto-close Bugzilla Severity Description
7184 normal parse error on *(x)++

Testing this PR locally

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

dub fetch digger
dub run digger -- build "master + dmd#8218"

Copy link
Member

@andralex andralex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clean code!

@JinShil JinShil changed the title fix issue 7184 fix issue 7184 - parse error on *(x)++ May 17, 2018
e = parseUnaryExp();
e = new AST.CastExp(loc, e, t);
error("C style cast illegal, use `%s`", e.toChars());
error("identifier or new keyword expected following `(...)`.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not appear to be covered by any test. Please add coverage. You can add a test to the fail_compilation directory to verify compile errors.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not changed any code here. The code is from line 8007. The diff display is not very accurate.

break;
else
{
e = parseUnaryExp();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block does not appear to be covered by any test. Please add coverage. You can add a test to the fail_compilation directory to verify compile errors.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line comes from line 8015.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a test for this at #8256. It should be pulled before this PR to ensure there isn't any breakage.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new test is now broken by this PR.

@arBmind
Copy link
Contributor Author

arBmind commented May 17, 2018

To make this clear. I have not added any logic. This patch only removes code. This broke no existing unit test. I added a test that shows that the wrong behavior was fixed.

If there was logic without a test before there is no test now. These should be added in a different PR.

@JinShil
Copy link
Contributor

JinShil commented May 17, 2018

@arBmind We need a copyright assignment declaration from you. Please see instructions in the Readme of this repository.

@arBmind
Copy link
Contributor Author

arBmind commented May 17, 2018

@JinShil Sorry this is legally not possible in Germany. The law here is basically "the Copyright is always by the author". I can only give away all kinds of "usage rights". If this is not compatible with this project, feel free to close this PR and use my work (the diff) on your own behalf or ignore it entirely.

If you want to be compatible with every law, take a look at the CLA of Microsoft. https://cla.microsoft.com - The only CLA I was able to sign so far.

@WalterBright
Copy link
Member

If you prefer, it works if you take the Microsoft CLA, s/Microsoft/D Language Foundation/, sign it and email it to us. Thanks!
(The license in the CLA allows us to make those changes!)

@arBmind
Copy link
Contributor Author

arBmind commented May 17, 2018

@WalterBright the email was sent.

@arBmind
Copy link
Contributor Author

arBmind commented May 17, 2018

It seems there are more bugs in this section of the parsing code. I wont have time for further deep investigations. Feel free to close this PR at will.

@RazvanN7 RazvanN7 closed this May 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
6 participants