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), // Simple instruction (might turn into functional),
// literal, // literal,
// identifier (might turn into label or functional assignment) // identifier (might turn into label or functional assignment)
Statement statement(parseElementaryOperation()); Statement statement(parseElementaryOperation(false));
switch (m_scanner->currentToken()) switch (m_scanner->currentToken())
{ {
case Token::LParen: case Token::LParen:
@ -214,7 +214,11 @@ assembly::Statement Parser::parseElementaryOperation(bool _onlySinglePusher)
break; break;
} }
default: default:
fatalParserError("Expected elementary inline assembly operation."); fatalParserError(
m_julia ?
"Literal or identifier expected." :
"Expected elementary inline assembly operation."
);
} }
m_scanner->next(); m_scanner->next();
return ret; return ret;
@ -322,7 +326,11 @@ assembly::Statement Parser::parseFunctionalInstruction(assembly::Statement&& _in
return ret; return ret;
} }
else 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 {}; return {};
} }