From db71af8ddb5e39e2f11010354e6671c755844ad3 Mon Sep 17 00:00:00 2001 From: Callum Anderson Date: Thu, 6 Mar 2014 10:29:29 +1100 Subject: [PATCH] Allow member func attrs after postblit --- stdx/d/ast.d | 1 + stdx/d/parser.d | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/stdx/d/ast.d b/stdx/d/ast.d index 636b516..03c1a82 100644 --- a/stdx/d/ast.d +++ b/stdx/d/ast.d @@ -1996,6 +1996,7 @@ public: mixin (visitIfNotNull!(functionBody)); } /** */ FunctionBody functionBody; + /** */ MemberFunctionAttribute[] memberFunctionAttributes; } /// diff --git a/stdx/d/parser.d b/stdx/d/parser.d index a95ec5a..0e384fc 100644 --- a/stdx/d/parser.d +++ b/stdx/d/parser.d @@ -4134,7 +4134,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() @@ -4144,6 +4144,8 @@ q{(int a, ...) expect(tok!"("); expect(tok!"this"); expect(tok!")"); + while (currentIsMemberFunctionAttribute()) + node.memberFunctionAttributes ~= parseMemberFunctionAttribute(); if (currentIs(tok!";")) advance(); else