mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Remove scanner from compiler stack.
This commit is contained in:
committed by
Christian Parpart
parent
af18b8afc2
commit
ffc5cfd9a5
@@ -74,7 +74,8 @@ pair<shared_ptr<Object>, shared_ptr<yul::AsmAnalysisInfo>> yul::test::parse(
|
||||
)
|
||||
{
|
||||
ErrorReporter errorReporter(_errors);
|
||||
shared_ptr<Scanner> scanner = make_shared<Scanner>(CharStream(_source, ""));
|
||||
CharStream stream(_source, "");
|
||||
shared_ptr<Scanner> scanner = make_shared<Scanner>(stream);
|
||||
shared_ptr<Object> parserResult = yul::ObjectParser(errorReporter, _dialect).parse(scanner, false);
|
||||
if (!parserResult)
|
||||
return {};
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
|
||||
#include <test/libsolidity/ErrorCheck.h>
|
||||
|
||||
#include <liblangutil/Scanner.h>
|
||||
|
||||
#include <libyul/AssemblyStack.h>
|
||||
#include <libyul/backends/evm/EVMDialect.h>
|
||||
|
||||
@@ -118,7 +120,8 @@ tuple<optional<ObjectParser::SourceNameMap>, ErrorList> tryGetSourceLocationMapp
|
||||
ErrorReporter reporter(errors);
|
||||
Dialect const& dialect = yul::EVMDialect::strictAssemblyForEVM(EVMVersion::berlin());
|
||||
ObjectParser objectParser{reporter, dialect};
|
||||
objectParser.parse(make_shared<Scanner>(CharStream(move(source), "")), false);
|
||||
CharStream stream(move(source), "");
|
||||
objectParser.parse(make_shared<Scanner>(stream), false);
|
||||
return {objectParser.sourceNameMapping(), std::move(errors)};
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,8 @@ shared_ptr<Block> parse(string const& _source, Dialect const& _dialect, ErrorRep
|
||||
{
|
||||
try
|
||||
{
|
||||
auto scanner = make_shared<Scanner>(CharStream(_source, ""));
|
||||
auto stream = CharStream(_source, "");
|
||||
auto scanner = make_shared<Scanner>(stream);
|
||||
map<unsigned, shared_ptr<string const>> indicesToSourceNames;
|
||||
indicesToSourceNames[0] = make_shared<string const>("source0");
|
||||
indicesToSourceNames[1] = make_shared<string const>("source1");
|
||||
|
||||
Reference in New Issue
Block a user