Show better error message for Julia mode

This commit is contained in:
Alex Beregszaszi 2017-05-02 09:25:12 +01:00
parent f1f209db40
commit 804971973d

View File

@ -92,7 +92,7 @@ assembly::Statement Parser::parseStatement()
// Simple instruction (might turn into functional),
// literal,
// identifier (might turn into label or functional assignment)
Statement statement(parseElementaryOperation());
Statement statement(parseElementaryOperation(false));
switch (m_scanner->currentToken())
{
case Token::LParen:
@ -214,7 +214,11 @@ assembly::Statement Parser::parseElementaryOperation(bool _onlySinglePusher)
break;
}
default:
fatalParserError("Expected elementary inline assembly operation.");
fatalParserError(
m_julia ?
"Literal or identifier expected." :
"Expected elementary inline assembly operation."
);
}
m_scanner->next();
return ret;
@ -322,7 +326,11 @@ assembly::Statement Parser::parseFunctionalInstruction(assembly::Statement&& _in
return ret;
}
else
fatalParserError("Assembly instruction or function name required in front of \"(\")");
fatalParserError(
m_julia ?
"Function name expected." :
"Assembly instruction or function name required in front of \"(\")"
);
return {};
}