diff options
author | Alex Sinyagin <sinyagin.alexander@gmail.com> | 2016-08-16 23:38:24 +0800 |
---|---|---|
committer | Alex Sinyagin <sinyagin.alexander@gmail.com> | 2016-08-18 20:29:59 +0800 |
commit | 95832da16ea1577dd50e62212dd0ea620e2fcaeb (patch) | |
tree | 67c7c9eae1aafa4d1af252cabadddb29466a2622 /libsolidity | |
parent | a9e04217a4f22eb9869a7830ba8f33bd72f2e452 (diff) | |
download | dexon-solidity-95832da16ea1577dd50e62212dd0ea620e2fcaeb.tar.gz dexon-solidity-95832da16ea1577dd50e62212dd0ea620e2fcaeb.tar.zst dexon-solidity-95832da16ea1577dd50e62212dd0ea620e2fcaeb.zip |
Add ast json converter for EnumValue
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/ast/ASTJsonConverter.cpp | 11 | ||||
-rw-r--r-- | libsolidity/ast/ASTJsonConverter.h | 2 |
2 files changed, 13 insertions, 0 deletions
diff --git a/libsolidity/ast/ASTJsonConverter.cpp b/libsolidity/ast/ASTJsonConverter.cpp index 1b792694..9af002a3 100644 --- a/libsolidity/ast/ASTJsonConverter.cpp +++ b/libsolidity/ast/ASTJsonConverter.cpp @@ -144,6 +144,12 @@ bool ASTJsonConverter::visit(EnumDefinition const& _node) return true; } +bool ASTJsonConverter::visit(EnumValue const& _node) +{ + addJsonNode(_node, "EnumValue", { make_pair("name", _node.name()) }, true); + return true; +} + bool ASTJsonConverter::visit(ParameterList const& _node) { addJsonNode(_node, "ParameterList", {}, true); @@ -383,6 +389,11 @@ void ASTJsonConverter::endVisit(EnumDefinition const&) goUp(); } +void ASTJsonConverter::endVisit(EnumValue const&) +{ + goUp(); +} + void ASTJsonConverter::endVisit(ParameterList const&) { goUp(); diff --git a/libsolidity/ast/ASTJsonConverter.h b/libsolidity/ast/ASTJsonConverter.h index 4ee21803..009c9607 100644 --- a/libsolidity/ast/ASTJsonConverter.h +++ b/libsolidity/ast/ASTJsonConverter.h @@ -57,6 +57,7 @@ public: bool visit(UsingForDirective const& _node) override; bool visit(StructDefinition const& _node) override; bool visit(EnumDefinition const& _node) override; + bool visit(EnumValue const& _node) override; bool visit(ParameterList const& _node) override; bool visit(FunctionDefinition const& _node) override; bool visit(VariableDeclaration const& _node) override; @@ -94,6 +95,7 @@ public: void endVisit(UsingForDirective const&) override; void endVisit(StructDefinition const&) override; void endVisit(EnumDefinition const&) override; + void endVisit(EnumValue const&) override; void endVisit(ParameterList const&) override; void endVisit(FunctionDefinition const&) override; void endVisit(VariableDeclaration const&) override; |