process some of the feedback

This commit is contained in:
Daniel Lupu 2022-11-27 17:52:52 +02:00 committed by r0qs
parent 9bd7f3553e
commit bf9c95f5c9
No known key found for this signature in database
GPG Key ID: 61503DBA6667276C

View File

@ -100,8 +100,13 @@ public:
auto scanner = make_shared<Scanner>(charStream);
if (!m_inputIsCodeBlock && scanner->currentToken() == Token::LBrace)
{
m_inputIsCodeBlock = true;
if (!_objectPath.empty())
throw runtime_error("Object path argument cannot be used. Input is a code block.");
}
shared_ptr<Object> object = parser.parse(scanner, false);
if (!object || !errorReporter.errors().empty())
@ -262,8 +267,14 @@ public:
{
if (!m_inputIsCodeBlock)
cout << m_object->toString(&m_dialect) << endl;
else
else {
yulAssert(
m_object->subObjects.empty(),
"Unexpected subObjects found."
);
cout << AsmPrinter{m_dialect}(*m_object->code) << endl;
}
}
void resetNameDispenser()