aboutsummaryrefslogtreecommitdiffstats
path: root/ASTJsonConverter.h
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2015-01-16 18:44:55 +0800
committerLefteris Karapetsas <lefteris@refu.co>2015-01-16 19:35:59 +0800
commit839f7778b5b9c9e0dbaa1b3ca212a616b523c61c (patch)
treee8ed8a383d596439d5587aa2da3378e33cdff743 /ASTJsonConverter.h
parent9c8ce499693c13c32773ae65181573140ca1fc74 (diff)
downloaddexon-solidity-839f7778b5b9c9e0dbaa1b3ca212a616b523c61c.tar.gz
dexon-solidity-839f7778b5b9c9e0dbaa1b3ca212a616b523c61c.tar.zst
dexon-solidity-839f7778b5b9c9e0dbaa1b3ca212a616b523c61c.zip
Style fixes and refactoring in ASTJsonConverter
Diffstat (limited to 'ASTJsonConverter.h')
-rw-r--r--ASTJsonConverter.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/ASTJsonConverter.h b/ASTJsonConverter.h
index 69030f39..7d9b9bc0 100644
--- a/ASTJsonConverter.h
+++ b/ASTJsonConverter.h
@@ -26,6 +26,7 @@
#include <stack>
#include <libsolidity/ASTVisitor.h>
#include <libsolidity/Exceptions.h>
+#include <libsolidity/Utils.h>
#include <jsoncpp/json/json.h>
namespace dev
@@ -39,8 +40,7 @@ namespace solidity
class ASTJsonConverter: public ASTConstVisitor
{
public:
- /// Create a converter for the given abstract syntax tree. If the source is specified,
- /// the corresponding parts of the source are printed with each node.
+ /// Create a converter to JSON for the given abstract syntax tree.
ASTJsonConverter(ASTNode const& _ast);
/// Output the json representation of the AST to _stream.
void print(std::ostream& _stream);
@@ -118,11 +118,10 @@ private:
void addJsonNode(std::string const& _nodeName,
std::initializer_list<std::pair<std::string const, std::string const>> _list,
bool _hasChildren);
- std::string const getType(Expression const& _expression);
+ std::string getType(Expression const& _expression);
inline void goUp()
{
- if (m_jsonNodePtrs.empty())
- BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Internal error"));
+ solAssert(!m_jsonNodePtrs.empty(), "Uneven json nodes stack. Internal error.");
m_jsonNodePtrs.pop();
};