Add declaration attributes to the relevant FunctionAttributes object
This commit is contained in:
parent
885d0d2ff5
commit
e99bf1f616
|
@ -1531,6 +1531,7 @@ public:
|
|||
/** */ FunctionBody functionBody;
|
||||
/** */ MemberFunctionAttribute[] memberFunctionAttributes;
|
||||
/** */ string comment;
|
||||
/** */ Attribute[] attributes;
|
||||
mixin OpEquals;
|
||||
}
|
||||
|
||||
|
|
|
@ -1790,7 +1790,7 @@ class ClassFive(A, B) : Super if (someTest()) {}}c;
|
|||
if (peekIs(tok!"="))
|
||||
node.variableDeclaration = parseVariableDeclaration(null, true);
|
||||
else if (peekIs(tok!"("))
|
||||
node.functionDeclaration = parseFunctionDeclaration(null, true);
|
||||
node.functionDeclaration = parseFunctionDeclaration(null, true, node.attributes);
|
||||
else
|
||||
goto type;
|
||||
}
|
||||
|
@ -1811,7 +1811,7 @@ class ClassFive(A, B) : Super if (someTest()) {}}c;
|
|||
return null;
|
||||
}
|
||||
if (peekIs(tok!"("))
|
||||
node.functionDeclaration = parseFunctionDeclaration(type);
|
||||
node.functionDeclaration = parseFunctionDeclaration(type, false, node.attributes);
|
||||
else
|
||||
node.variableDeclaration = parseVariableDeclaration(type);
|
||||
break;
|
||||
|
@ -2540,7 +2540,7 @@ body {} // six
|
|||
* ($(RULE storageClass) | $(RULE _type)) $(LITERAL Identifier) $(RULE templateParameters) $(RULE parameters) $(RULE memberFunctionAttribute)* $(RULE constraint)? ($(RULE functionBody) | $(LITERAL ';'))
|
||||
* ;)
|
||||
*/
|
||||
FunctionDeclaration parseFunctionDeclaration(Type type = null, bool isAuto = false)
|
||||
FunctionDeclaration parseFunctionDeclaration(Type type = null, bool isAuto = false, Attribute[] attributes = null)
|
||||
{
|
||||
mixin(traceEnterAndExit!(__FUNCTION__));
|
||||
auto node = allocate!FunctionDeclaration;
|
||||
|
@ -2548,6 +2548,8 @@ body {} // six
|
|||
comment = null;
|
||||
MemberFunctionAttribute[] memberFunctionAttributes;
|
||||
|
||||
node.attributes = attributes;
|
||||
|
||||
if (isAuto)
|
||||
goto functionName;
|
||||
|
||||
|
|
Loading…
Reference in New Issue