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