Yul parser hack and more yul tests.

This commit is contained in:
Daniel Kirchner 2020-05-05 17:22:54 +02:00
parent 28d25afab1
commit b580106c80
4 changed files with 8 additions and 3 deletions

View File

@ -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);

View File

@ -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

View File

@ -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"

View File

@ -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 #