aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/ast
diff options
context:
space:
mode:
authorAlex Sinyagin <sinyagin.alexander@gmail.com>2016-08-16 23:38:24 +0800
committerAlex Sinyagin <sinyagin.alexander@gmail.com>2016-08-18 20:29:59 +0800
commit95832da16ea1577dd50e62212dd0ea620e2fcaeb (patch)
tree67c7c9eae1aafa4d1af252cabadddb29466a2622 /libsolidity/ast
parenta9e04217a4f22eb9869a7830ba8f33bd72f2e452 (diff)
downloaddexon-solidity-95832da16ea1577dd50e62212dd0ea620e2fcaeb.tar
dexon-solidity-95832da16ea1577dd50e62212dd0ea620e2fcaeb.tar.gz
dexon-solidity-95832da16ea1577dd50e62212dd0ea620e2fcaeb.tar.bz2
dexon-solidity-95832da16ea1577dd50e62212dd0ea620e2fcaeb.tar.lz
dexon-solidity-95832da16ea1577dd50e62212dd0ea620e2fcaeb.tar.xz
dexon-solidity-95832da16ea1577dd50e62212dd0ea620e2fcaeb.tar.zst
dexon-solidity-95832da16ea1577dd50e62212dd0ea620e2fcaeb.zip
Add ast json converter for EnumValue
Diffstat (limited to 'libsolidity/ast')
-rw-r--r--libsolidity/ast/ASTJsonConverter.cpp11
-rw-r--r--libsolidity/ast/ASTJsonConverter.h2
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;