Skip to content

parse static foreach patch for issue #157#169

Merged
Hackerpilot merged 5 commits intodlang-community:masterfrom
SSoulaimane:static-foreach-patch
Sep 5, 2017
Merged

parse static foreach patch for issue #157#169
Hackerpilot merged 5 commits intodlang-community:masterfrom
SSoulaimane:static-foreach-patch

Conversation

@SSoulaimane
Copy link
Contributor

@SSoulaimane SSoulaimane commented Sep 1, 2017

parse static foreach #157 which is now in dmd official release since 2.076.0

@Hackerpilot Hackerpilot self-requested a review September 1, 2017 22:42
@Hackerpilot Hackerpilot self-assigned this Sep 1, 2017
@codecov-io
Copy link

codecov-io commented Sep 1, 2017

Codecov Report

Merging #169 into master will increase coverage by 0.02%.
The diff coverage is 82.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #169      +/-   ##
==========================================
+ Coverage   81.79%   81.81%   +0.02%     
==========================================
  Files           7        7              
  Lines        4570     4598      +28     
==========================================
+ Hits         3738     3762      +24     
- Misses        832      836       +4
Impacted Files Coverage Δ
src/dparse/ast.d 15% <0%> (-0.1%) ⬇️
src/dparse/parser.d 87.96% <86.84%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a4cdc47...1dcb9e6. Read the comment docs.

Copy link
Collaborator

@Hackerpilot Hackerpilot left a comment

Choose a reason for hiding this comment

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

Looks good so far. I'd like to see a test case that checks that the new alias and enum attributes are parsed for the foreach statement.

else
{
error("'if' or 'assert' expected.");
error("'if' or 'assert' or 'foreach' or 'foreach_reverse' expected.");
Copy link
Collaborator

Choose a reason for hiding this comment

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

error("'if', 'assert', 'foreach', or 'foreach_reverse' expected.");

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'd like to see a test case that checks that the new alias and enum attributes are parsed for the foreach statement.

Thank you @Hackerpilot for the review. I didn't know there were new type attributes.

advance();
}
else if (currentIs(tok!"alias"))
advance(); // TODO: where should I put this
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'm not sure where the new attributes should be added. Should I make a new field IdType[] attributes? if so should it include ref? should it just be an alias to typeConstructors field? Should I add two more flags bool isEnum and bool isAlias? Or should it be a IdType enumOrAlias field?

Copy link
Collaborator

Choose a reason for hiding this comment

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

That's a good question. Adding the extra isEnum and isAlias fields would mean that there aren't any backwards-incompatible changes to the AST classes, so I think that's the better thing to do even thought it might not result in the cleanest design.

@Hackerpilot Hackerpilot merged commit 222548f into dlang-community:master Sep 5, 2017
@wilzbach
Copy link
Member

Tagged this as v0.7.2-alpha.1

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.

4 participants