Merge pull request #142 from callumenator/postblit-attr

Allow member func attrs after postblit
This commit is contained in:
Hackerpilot 2014-03-05 20:37:50 -08:00
commit f146cc8d89
2 changed files with 6 additions and 1 deletions

View File

@ -1996,6 +1996,7 @@ public:
mixin (visitIfNotNull!(functionBody));
}
/** */ FunctionBody functionBody;
/** */ MemberFunctionAttribute[] memberFunctionAttributes;
}
///

View File

@ -4140,7 +4140,7 @@ q{(int a, ...)
* Parses a Postblit
*
* $(GRAMMAR $(RULEDEF postblit):
* $(LITERAL 'this') $(LITERAL '$(LPAREN)') $(LITERAL 'this') $(LITERAL '$(RPAREN)') ($(RULE functionBody) | $(LITERAL ';'))
* $(LITERAL 'this') $(LITERAL '$(LPAREN)') $(LITERAL 'this') $(LITERAL '$(RPAREN)') $(RULE memberFunctionAttribute)* ($(RULE functionBody) | $(LITERAL ';'))
* ;)
*/
Postblit parsePostblit()
@ -4150,6 +4150,10 @@ q{(int a, ...)
expect(tok!"(");
expect(tok!"this");
expect(tok!")");
MemberFunctionAttribute[] memberFunctionAttributes;
while (currentIsMemberFunctionAttribute())
memberFunctionAttributes ~= parseMemberFunctionAttribute();
node.memberFunctionAttributes = ownArray(memberFunctionAttributes);
if (currentIs(tok!";"))
advance();
else