mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Remove asm flavour.
This commit is contained in:
+22
-1
@@ -75,6 +75,27 @@ pair<shared_ptr<Block>, shared_ptr<yul::AsmAnalysisInfo>> yul::test::parse(strin
|
||||
return make_pair(stack.parserResult()->code, stack.parserResult()->analysisInfo);
|
||||
}
|
||||
|
||||
pair<shared_ptr<Block>, shared_ptr<yul::AsmAnalysisInfo>> yul::test::parse(
|
||||
string const& _source,
|
||||
Dialect const& _dialect,
|
||||
ErrorList& _errors
|
||||
)
|
||||
{
|
||||
ErrorReporter errorReporter(_errors);
|
||||
shared_ptr<Scanner> scanner = make_shared<Scanner>(CharStream(_source, ""));
|
||||
shared_ptr<Object> parserResult = yul::ObjectParser(errorReporter, _dialect).parse(scanner, false);
|
||||
if (!parserResult)
|
||||
return {};
|
||||
if (!parserResult->code || !errorReporter.errors().empty())
|
||||
return {};
|
||||
shared_ptr<AsmAnalysisInfo> analysisInfo = make_shared<AsmAnalysisInfo>();
|
||||
AsmAnalyzer analyzer(*analysisInfo, errorReporter, _dialect, {}, parserResult->dataNames());
|
||||
// TODO this should be done recursively.
|
||||
if (!analyzer.analyze(*parserResult->code) || !errorReporter.errors().empty())
|
||||
return {};
|
||||
return {std::move(parserResult->code), std::move(analysisInfo)};
|
||||
}
|
||||
|
||||
yul::Block yul::test::disambiguate(string const& _source, bool _yul)
|
||||
{
|
||||
auto result = parse(_source, _yul);
|
||||
@@ -83,5 +104,5 @@ yul::Block yul::test::disambiguate(string const& _source, bool _yul)
|
||||
|
||||
string yul::test::format(string const& _source, bool _yul)
|
||||
{
|
||||
return yul::AsmPrinter(_yul)(*parse(_source, _yul).first);
|
||||
return yul::AsmPrinter()(*parse(_source, _yul).first);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user