Fix AST output if modifier invocation is base constructor call.

This commit is contained in:
chriseth 2021-03-24 11:19:38 +01:00
parent 70c1720903
commit d15ba987d1
3 changed files with 4 additions and 3 deletions

View File

@ -7,6 +7,7 @@ Compiler Features:
Bugfixes:
* AST Output: Fix ``kind`` field of ``ModifierInvocation`` for base constructor calls.
AST Changes:

View File

@ -461,9 +461,8 @@ bool ASTJsonConverter::visit(ModifierInvocation const& _node)
{
if (dynamic_cast<ModifierDefinition const*>(declaration))
attributes.emplace_back("kind", "modifierInvocation");
else if (FunctionDefinition const* function = dynamic_cast<FunctionDefinition const*>(declaration))
if (function->isConstructor())
attributes.emplace_back("kind", "baseConstructorSpecifier");
else if (dynamic_cast<ContractDefinition const*>(declaration))
attributes.emplace_back("kind", "baseConstructorSpecifier");
}
setJsonNode(_node, "ModifierInvocation", move(attributes));
return false;

View File

@ -172,6 +172,7 @@
}
],
"id": 13,
"kind": "baseConstructorSpecifier",
"modifierName":
{
"id": 11,