mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Refactoring: Check types outside of AST and recover from some errors.
This commit is contained in:
@@ -232,19 +232,19 @@ bool ASTJsonConverter::visit(UnaryOperation const& _node)
|
||||
|
||||
bool ASTJsonConverter::visit(BinaryOperation const& _node)
|
||||
{
|
||||
addJsonNode("BinaryOperation",
|
||||
{ make_pair("operator", Token::toString(_node.getOperator())),
|
||||
make_pair("type", type(_node))},
|
||||
true);
|
||||
addJsonNode("BinaryOperation", {
|
||||
make_pair("operator", Token::toString(_node.getOperator())),
|
||||
make_pair("type", type(_node))
|
||||
}, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ASTJsonConverter::visit(FunctionCall const& _node)
|
||||
{
|
||||
addJsonNode("FunctionCall",
|
||||
{ make_pair("type_conversion", boost::lexical_cast<std::string>(_node.isTypeConversion())),
|
||||
make_pair("type", type(_node)) },
|
||||
true);
|
||||
addJsonNode("FunctionCall", {
|
||||
make_pair("type_conversion", boost::lexical_cast<std::string>(_node.annotation().isTypeConversion)),
|
||||
make_pair("type", type(_node))
|
||||
}, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -441,7 +441,7 @@ void ASTJsonConverter::process()
|
||||
|
||||
string ASTJsonConverter::type(Expression const& _expression)
|
||||
{
|
||||
return (_expression.type()) ? _expression.type()->toString() : "Unknown";
|
||||
return _expression.annotation().type ? _expression.annotation().type->toString() : "Unknown";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user