Use yul::test::parse in libyul/SynaxtTests to support objects

This commit is contained in:
Alex Beregszaszi 2020-08-04 23:51:58 +01:00
parent 98faf82d3f
commit e7c99918ed

View File

@ -26,6 +26,8 @@
#include <test/libyul/Common.h> #include <test/libyul/Common.h>
#include <test/libyul/SyntaxTest.h> #include <test/libyul/SyntaxTest.h>
#include <test/libsolidity/util/SoltestErrors.h>
#include <test/Common.h> #include <test/Common.h>
using namespace std; using namespace std;
@ -43,17 +45,9 @@ void SyntaxTest::parseAndAnalyze()
string const& source = m_sources.begin()->second; string const& source = m_sources.begin()->second;
ErrorList errorList{}; ErrorList errorList{};
ErrorReporter errorReporter{errorList}; soltestAssert(m_dialect, "");
// Silently ignoring the results.
auto scanner = make_shared<Scanner>(CharStream(source, name)); yul::test::parse(source, *m_dialect, errorList);
auto parserResult = yul::Parser(errorReporter, *m_dialect).parse(scanner, false);
if (parserResult)
{
yul::AsmAnalysisInfo analysisInfo;
yul::AsmAnalyzer(analysisInfo, errorReporter, *m_dialect).analyze(*parserResult);
}
for (auto const& error: errorList) for (auto const& error: errorList)
{ {
int locationStart = -1; int locationStart = -1;