mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Allow "byte" in inline assembly.
This commit is contained in:
parent
12797ed6c9
commit
26a91109a7
@ -73,6 +73,7 @@ assembly::Statement Parser::parseStatement()
|
||||
return assembly::Assignment{assembly::Identifier{name}};
|
||||
}
|
||||
case Token::Return: // opcode
|
||||
case Token::Byte: // opcode
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -143,10 +144,13 @@ assembly::Statement Parser::parseElementaryOperation(bool _onlySinglePusher)
|
||||
{
|
||||
case Token::Identifier:
|
||||
case Token::Return:
|
||||
case Token::Byte:
|
||||
{
|
||||
string literal;
|
||||
if (m_scanner->currentToken() == Token::Return)
|
||||
literal = "return";
|
||||
else if (m_scanner->currentToken() == Token::Byte)
|
||||
literal = "byte";
|
||||
else
|
||||
literal = m_scanner->currentLiteral();
|
||||
// first search the set of instructions.
|
||||
|
@ -88,6 +88,11 @@ BOOST_AUTO_TEST_CASE(simple_instructions)
|
||||
BOOST_CHECK(successParse("{ dup1 dup1 mul dup1 sub }"));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(keywords)
|
||||
{
|
||||
BOOST_CHECK(successParse("{ byte return }"));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(constants)
|
||||
{
|
||||
BOOST_CHECK(successParse("{ 7 8 mul }"));
|
||||
|
Loading…
Reference in New Issue
Block a user