aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/inlineasm/AsmParser.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-11-21 20:36:41 +0800
committerchriseth <chris@ethereum.org>2017-11-22 23:25:24 +0800
commit6dbc34e16ee8bda0e156ccb20a3fb8cb6ff52c92 (patch)
treec7e5c438ef7517293c08f4e0516f8c38c9a7c5c6 /libsolidity/inlineasm/AsmParser.cpp
parentff229ab05a43d113bcd2de79f25caf52017c3486 (diff)
downloaddexon-solidity-6dbc34e16ee8bda0e156ccb20a3fb8cb6ff52c92.tar
dexon-solidity-6dbc34e16ee8bda0e156ccb20a3fb8cb6ff52c92.tar.gz
dexon-solidity-6dbc34e16ee8bda0e156ccb20a3fb8cb6ff52c92.tar.bz2
dexon-solidity-6dbc34e16ee8bda0e156ccb20a3fb8cb6ff52c92.tar.lz
dexon-solidity-6dbc34e16ee8bda0e156ccb20a3fb8cb6ff52c92.tar.xz
dexon-solidity-6dbc34e16ee8bda0e156ccb20a3fb8cb6ff52c92.tar.zst
dexon-solidity-6dbc34e16ee8bda0e156ccb20a3fb8cb6ff52c92.zip
If statement for Iulia / inline assembly.
Diffstat (limited to 'libsolidity/inlineasm/AsmParser.cpp')
-rw-r--r--libsolidity/inlineasm/AsmParser.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/libsolidity/inlineasm/AsmParser.cpp b/libsolidity/inlineasm/AsmParser.cpp
index 1f4df75b..8f171005 100644
--- a/libsolidity/inlineasm/AsmParser.cpp
+++ b/libsolidity/inlineasm/AsmParser.cpp
@@ -73,13 +73,23 @@ assembly::Statement Parser::parseStatement()
return parseFunctionDefinition();
case Token::LBrace:
return parseBlock();
+ case Token::If:
+ {
+ assembly::If _if = createWithLocation<assembly::If>();
+ m_scanner->next();
+ _if.condition = make_shared<Statement>(parseExpression());
+ if (_if.condition->type() == typeid(assembly::Instruction))
+ fatalParserError("Instructions are not supported as conditions for if - try to append \"()\".");
+ _if.body = parseBlock();
+ return _if;
+ }
case Token::Switch:
{
assembly::Switch _switch = createWithLocation<assembly::Switch>();
m_scanner->next();
_switch.expression = make_shared<Statement>(parseExpression());
if (_switch.expression->type() == typeid(assembly::Instruction))
- fatalParserError("Instructions are not supported as expressions for switch.");
+ fatalParserError("Instructions are not supported as expressions for switch - try to append \"()\".");
while (m_scanner->currentToken() == Token::Case)
_switch.cases.emplace_back(parseCase());
if (m_scanner->currentToken() == Token::Default)