mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Introduce the concept of builtin functions.
This commit is contained in:
@@ -54,11 +54,11 @@ void yul::test::printErrors(ErrorList const& _errors, Scanner const& _scanner)
|
||||
|
||||
pair<shared_ptr<Block>, shared_ptr<yul::AsmAnalysisInfo>> yul::test::parse(string const& _source, bool _yul)
|
||||
{
|
||||
auto flavour = _yul ? yul::AsmFlavour::Yul : yul::AsmFlavour::Strict;
|
||||
Dialect dialect = _yul ? yul::Dialect::yul() : yul::Dialect::strictAssemblyForEVM();
|
||||
ErrorList errors;
|
||||
ErrorReporter errorReporter(errors);
|
||||
auto scanner = make_shared<Scanner>(CharStream(_source, ""));
|
||||
auto parserResult = yul::Parser(errorReporter, flavour).parse(scanner, false);
|
||||
auto parserResult = yul::Parser(errorReporter, dialect).parse(scanner, false);
|
||||
if (parserResult)
|
||||
{
|
||||
BOOST_REQUIRE(errorReporter.errors().empty());
|
||||
@@ -68,7 +68,7 @@ pair<shared_ptr<Block>, shared_ptr<yul::AsmAnalysisInfo>> yul::test::parse(strin
|
||||
errorReporter,
|
||||
dev::test::Options::get().evmVersion(),
|
||||
boost::none,
|
||||
flavour
|
||||
dialect
|
||||
);
|
||||
if (analyzer.analyze(*parserResult))
|
||||
{
|
||||
|
||||
@@ -52,7 +52,7 @@ bool parse(string const& _source, ErrorReporter& errorReporter)
|
||||
try
|
||||
{
|
||||
auto scanner = make_shared<Scanner>(CharStream(_source, ""));
|
||||
auto parserResult = yul::Parser(errorReporter, yul::AsmFlavour::Yul).parse(scanner, false);
|
||||
auto parserResult = yul::Parser(errorReporter, yul::Dialect::yul()).parse(scanner, false);
|
||||
if (parserResult)
|
||||
{
|
||||
yul::AsmAnalysisInfo analysisInfo;
|
||||
@@ -61,7 +61,7 @@ bool parse(string const& _source, ErrorReporter& errorReporter)
|
||||
errorReporter,
|
||||
dev::test::Options::get().evmVersion(),
|
||||
boost::none,
|
||||
yul::AsmFlavour::Yul
|
||||
yul::Dialect::yul()
|
||||
)).analyze(*parserResult);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,11 +256,11 @@ void YulOptimizerTest::printIndented(ostream& _stream, string const& _output, st
|
||||
|
||||
bool YulOptimizerTest::parse(ostream& _stream, string const& _linePrefix, bool const _formatted)
|
||||
{
|
||||
yul::AsmFlavour flavour = m_yul ? yul::AsmFlavour::Yul : yul::AsmFlavour::Strict;
|
||||
yul::Dialect dialect = m_yul ? yul::Dialect::yul() : yul::Dialect::strictAssemblyForEVM();
|
||||
ErrorList errors;
|
||||
ErrorReporter errorReporter(errors);
|
||||
shared_ptr<Scanner> scanner = make_shared<Scanner>(CharStream(m_source, ""));
|
||||
m_ast = yul::Parser(errorReporter, flavour).parse(scanner, false);
|
||||
m_ast = yul::Parser(errorReporter, dialect).parse(scanner, false);
|
||||
if (!m_ast || !errorReporter.errors().empty())
|
||||
{
|
||||
FormattedScope(_stream, _formatted, {formatting::BOLD, formatting::RED}) << _linePrefix << "Error parsing source." << endl;
|
||||
@@ -273,7 +273,7 @@ bool YulOptimizerTest::parse(ostream& _stream, string const& _linePrefix, bool c
|
||||
errorReporter,
|
||||
dev::test::Options::get().evmVersion(),
|
||||
boost::none,
|
||||
flavour
|
||||
dialect
|
||||
);
|
||||
if (!analyzer.analyze(*m_ast) || !errorReporter.errors().empty())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user