parse static foreach patch for issue #157#169
parse static foreach patch for issue #157#169Hackerpilot merged 5 commits intodlang-community:masterfrom
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
Hackerpilot
left a comment
There was a problem hiding this comment.
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."); |
There was a problem hiding this comment.
error("'if', 'assert', 'foreach', or 'foreach_reverse' expected.");
There was a problem hiding this comment.
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.
5b5aa55 to
a355f58
Compare
src/dparse/parser.d
Outdated
| advance(); | ||
| } | ||
| else if (currentIs(tok!"alias")) | ||
| advance(); // TODO: where should I put this |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
|
Tagged this as v0.7.2-alpha.1 |
parse static foreach #157 which is now in dmd official release since 2.076.0