mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Update UsingForDirective::functionsAndOperators to not expose ranges-v3
This commit is contained in:
parent
dcce3fa89b
commit
5fdd9cf591
@ -30,7 +30,9 @@
|
|||||||
#include <libsolutil/FunctionSelector.h>
|
#include <libsolutil/FunctionSelector.h>
|
||||||
#include <libsolutil/Keccak256.h>
|
#include <libsolutil/Keccak256.h>
|
||||||
|
|
||||||
|
#include <range/v3/range/conversion.hpp>
|
||||||
#include <range/v3/view/tail.hpp>
|
#include <range/v3/view/tail.hpp>
|
||||||
|
#include <range/v3/view/zip.hpp>
|
||||||
|
|
||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
|
|
||||||
@ -367,6 +369,11 @@ TypeDeclarationAnnotation& UserDefinedValueTypeDefinition::annotation() const
|
|||||||
return initAnnotation<TypeDeclarationAnnotation>();
|
return initAnnotation<TypeDeclarationAnnotation>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<std::pair<ASTPointer<IdentifierPath>, std::optional<Token>>> UsingForDirective::functionsAndOperators() const
|
||||||
|
{
|
||||||
|
return ranges::zip_view(m_functionsOrLibrary, m_operators) | ranges::to<vector>;
|
||||||
|
}
|
||||||
|
|
||||||
Type const* StructDefinition::type() const
|
Type const* StructDefinition::type() const
|
||||||
{
|
{
|
||||||
solAssert(annotation().recursive.has_value(), "Requested struct type before DeclarationTypeChecker.");
|
solAssert(annotation().recursive.has_value(), "Requested struct type before DeclarationTypeChecker.");
|
||||||
|
@ -38,7 +38,6 @@
|
|||||||
#include <json/json.h>
|
#include <json/json.h>
|
||||||
|
|
||||||
#include <range/v3/view/subrange.hpp>
|
#include <range/v3/view/subrange.hpp>
|
||||||
#include <range/v3/view/zip.hpp>
|
|
||||||
#include <range/v3/view/map.hpp>
|
#include <range/v3/view/map.hpp>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@ -692,7 +691,7 @@ public:
|
|||||||
|
|
||||||
/// @returns a list of functions or the single library.
|
/// @returns a list of functions or the single library.
|
||||||
std::vector<ASTPointer<IdentifierPath>> const& functionsOrLibrary() const { return m_functionsOrLibrary; }
|
std::vector<ASTPointer<IdentifierPath>> const& functionsOrLibrary() const { return m_functionsOrLibrary; }
|
||||||
auto functionsAndOperators() const { return ranges::zip_view(m_functionsOrLibrary, m_operators); }
|
std::vector<std::pair<ASTPointer<IdentifierPath>, std::optional<Token>>> functionsAndOperators() const;
|
||||||
bool usesBraces() const { return m_usesBraces; }
|
bool usesBraces() const { return m_usesBraces; }
|
||||||
bool global() const { return m_global; }
|
bool global() const { return m_global; }
|
||||||
|
|
||||||
|
@ -345,10 +345,10 @@ bool ASTJsonExporter::visit(UsingForDirective const& _node)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
auto const& functionAndOperators = _node.functionsAndOperators();
|
||||||
solAssert(_node.functionsAndOperators().size() == 1);
|
solAssert(_node.functionsAndOperators().size() == 1);
|
||||||
auto const& functionAndOperator = _node.functionsAndOperators().front();
|
solAssert(!functionAndOperators.front().second.has_value());
|
||||||
solAssert(!functionAndOperator.second.has_value());
|
attributes.emplace_back("libraryName", toJson(*(functionAndOperators.front().first)));
|
||||||
attributes.emplace_back("libraryName", toJson(*(functionAndOperator.first)));
|
|
||||||
}
|
}
|
||||||
attributes.emplace_back("global", _node.global());
|
attributes.emplace_back("global", _node.global());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user