File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed
test/cmdlineTests/asm_json_import_all_valid_flags Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 22
22
#include < liblangutil/Exceptions.h>
23
23
#include < libsolidity/codegen/CompilerContext.h>
24
24
25
+ #include < range/v3/view/enumerate.hpp>
26
+ #include < range/v3/view/transform.hpp>
27
+
25
28
#include < tuple>
26
29
27
30
using namespace solidity ::util;
@@ -73,12 +76,10 @@ LinkerObject const& EVMAssemblyStack::runtimeObject(std::string const& _contract
73
76
std::map<std::string, unsigned > EVMAssemblyStack::sourceIndices () const
74
77
{
75
78
solAssert (m_evmAssembly);
76
- std::map<std::string, unsigned > indices;
77
- unsigned index = 0 ;
78
- for (auto const & s: m_sourceList)
79
- if (s != CompilerContext::yulUtilityFileName ())
80
- indices[s] = index++;
81
- return indices;
79
+ return m_sourceList
80
+ | ranges::views::enumerate
81
+ | ranges::views::transform ([](auto const & _source) { return std::make_pair (_source.second , _source.first ); })
82
+ | ranges::to<std::map<std::string, unsigned >>;
82
83
}
83
84
84
85
std::string const * EVMAssemblyStack::sourceMapping (std::string const & _contractName) const
Original file line number Diff line number Diff line change 33
33
},
34
34
"sourceList":
35
35
[
36
- "contract.sol"
36
+ "contract.sol",
37
+ "#utility.yul"
37
38
]
38
39
},
39
40
"bin": "5ffe",
@@ -84,6 +85,7 @@ EVM assembly:
84
85
},
85
86
"sourceList":
86
87
[
87
- "contract.sol"
88
+ "contract.sol",
89
+ "#utility.yul"
88
90
]
89
91
}
You can’t perform that action at this time.
0 commit comments