-
-
Notifications
You must be signed in to change notification settings - Fork 652
Relax current limitations for UDA syntax parsing. #2924
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
Conversation
Being an enhancement, I'm going to leave this for 2.066! |
BTW, why UDAs don't allowed for module declaration?
|
@WalterBright Thanks. @IgorStepanov Because it is not allowed in grammar. Instead you can use |
May be we should allow it? Does fundamental objections aganist it exists?
No, I need to annotate module, not all module symbols. In my example, I collect data for all symbols to use it in runtime. But I start collect only if scoped symbol annotated with special attribute.
Thus I need to annotate module to say that it should be reflected (or shouldn't). |
Should we try to use the milestone feature to tag this pull request for 2.066? I'm wondering whether adding some kind of tagging would enable us to quickly see e.g. which pulls need reviewing, which are stalled for later, etc. |
@AndrejMitrovic Will also reduce amount of "will it be in next release?" questions. I'd love to see a milestone for every release, but is something that needs to be done by commiters/reviewers. |
Added this enhancement in the list of 2.066 targets on Agenda page. |
BTW, I don't think we should allow prefixes on module statements. The appearance of module as the first token in the file is handy for detecting D source code. |
… except that a |
Scope *newsc = sc; | ||
if (sc->protection != protection || | ||
sc->explicitProtection != 1) | ||
if (decl) |
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.
Might as well make it:
if (!decl)
return;
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.
Because the style if (decl) { ... }
is consistent with other functions style in attrib.c
.
It looks ok, but will probably need another reviewer as there's quite a few changes. |
Rebased. |
parseImport should return parsed `Import`s.
Parse prefix attributes in while loop of parseDeclDefs
Relax current limitations for UDA syntax parsing.
Thank you! |
Issue 11677 - user defined attributes must be first
Issue 11678 - user defined attributes cannot appear as postfixes
Issue 11679 - user defined attributes not allowed for local auto declarations
Issue 11680 - user defined attributes for type inference
Additionally, I added test cases for ddoc unittest feature to avoid silent breaking.