mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
User-defined literal suffixes: AST
This commit is contained in:
+10
-2
@@ -2156,9 +2156,15 @@ public:
|
||||
ASTPointer<Expression> _expression,
|
||||
std::vector<ASTPointer<Expression>> _arguments,
|
||||
std::vector<ASTPointer<ASTString>> _names,
|
||||
std::vector<SourceLocation> _nameLocations
|
||||
std::vector<SourceLocation> _nameLocations,
|
||||
bool _isSuffixCall = false
|
||||
):
|
||||
Expression(_id, _location), m_expression(std::move(_expression)), m_arguments(std::move(_arguments)), m_names(std::move(_names)), m_nameLocations(std::move(_nameLocations))
|
||||
Expression(_id, _location),
|
||||
m_expression(std::move(_expression)),
|
||||
m_arguments(std::move(_arguments)),
|
||||
m_names(std::move(_names)),
|
||||
m_nameLocations(std::move(_nameLocations)),
|
||||
m_isSuffixCall(_isSuffixCall)
|
||||
{
|
||||
solAssert(m_nameLocations.size() == m_names.size());
|
||||
}
|
||||
@@ -2176,6 +2182,7 @@ public:
|
||||
/// If this is not a named call, this is empty.
|
||||
std::vector<ASTPointer<ASTString>> const& names() const { return m_names; }
|
||||
std::vector<SourceLocation> const& nameLocations() const { return m_nameLocations; }
|
||||
bool isSuffixCall() const { return m_isSuffixCall; }
|
||||
|
||||
FunctionCallAnnotation& annotation() const override;
|
||||
|
||||
@@ -2184,6 +2191,7 @@ private:
|
||||
std::vector<ASTPointer<Expression>> m_arguments;
|
||||
std::vector<ASTPointer<ASTString>> m_names;
|
||||
std::vector<SourceLocation> m_nameLocations;
|
||||
bool m_isSuffixCall;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -878,7 +878,8 @@ bool ASTJsonExporter::visit(FunctionCall const& _node)
|
||||
make_pair("names", std::move(names)),
|
||||
make_pair("nameLocations", sourceLocationsToJson(_node.nameLocations())),
|
||||
make_pair("arguments", toJson(_node.arguments())),
|
||||
make_pair("tryCall", _node.annotation().tryCall)
|
||||
make_pair("tryCall", _node.annotation().tryCall),
|
||||
make_pair("isSuffixCall", _node.isSuffixCall())
|
||||
};
|
||||
|
||||
if (_node.annotation().kind.set())
|
||||
|
||||
@@ -965,7 +965,8 @@ ASTPointer<FunctionCall> ASTJsonImporter::createFunctionCall(Json::Value const&
|
||||
names,
|
||||
sourceLocations ?
|
||||
*sourceLocations :
|
||||
vector<SourceLocation>(names.size())
|
||||
vector<SourceLocation>(names.size()),
|
||||
memberAsBool(_node, "isSuffixCall")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user