mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Yul parser hack and more yul tests.
This commit is contained in:
parent
28d25afab1
commit
b580106c80
@ -325,6 +325,7 @@ Parser::ElementaryOperation Parser::parseElementaryOperation()
|
|||||||
case Token::Bool:
|
case Token::Bool:
|
||||||
case Token::Address:
|
case Token::Address:
|
||||||
case Token::Var:
|
case Token::Var:
|
||||||
|
case Token::In:
|
||||||
{
|
{
|
||||||
YulString literal{currentLiteral()};
|
YulString literal{currentLiteral()};
|
||||||
if (m_dialect.builtin(literal))
|
if (m_dialect.builtin(literal))
|
||||||
@ -515,6 +516,7 @@ YulString Parser::expectAsmIdentifier()
|
|||||||
case Token::Bool:
|
case Token::Bool:
|
||||||
case Token::Identifier:
|
case Token::Identifier:
|
||||||
case Token::Var:
|
case Token::Var:
|
||||||
|
case Token::In:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
expectToken(Token::Identifier);
|
expectToken(Token::Identifier);
|
||||||
|
@ -30,7 +30,8 @@ contract C {
|
|||||||
return arr[i](x);
|
return arr[i](x);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// ====
|
||||||
|
// compileViaYul: also
|
||||||
// ----
|
// ----
|
||||||
// test(uint256,uint256): 10, 0 -> 11
|
// test(uint256,uint256): 10, 0 -> 11
|
||||||
// test(uint256,uint256): 10, 1 -> 12
|
// test(uint256,uint256): 10, 1 -> 12
|
||||||
|
@ -10,6 +10,7 @@ contract C {
|
|||||||
require(y == bytes2(0xffff));
|
require(y == bytes2(0xffff));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// ====
|
||||||
|
// compileViaYul: also
|
||||||
// ----
|
// ----
|
||||||
// f() -> "\xff\xff\xff\xff"
|
// f() -> "\xff\xff\xff\xff"
|
||||||
|
@ -22,7 +22,8 @@ contract C {
|
|||||||
return garbled != garbled;
|
return garbled != garbled;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// ====
|
||||||
|
// compileViaYul: also
|
||||||
// ----
|
// ----
|
||||||
// test_eq_ok() -> 1
|
// test_eq_ok() -> 1
|
||||||
// test_eq() -> FAILURE # both should throw #
|
// test_eq() -> FAILURE # both should throw #
|
||||||
|
Loading…
Reference in New Issue
Block a user