aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/inlineasm/AsmParser.cpp
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-05-05 21:39:47 +0800
committerGitHub <noreply@github.com>2017-05-05 21:39:47 +0800
commitb0f2a5c162480ab6ecdc5e1397567242a137768a (patch)
treeef5e8ea960fd06070afccc196ddd84059f7eb63c /libsolidity/inlineasm/AsmParser.cpp
parent0582fcb93b2407379b5e4e4ce55c3f418e7ff433 (diff)
parent07176e82de05bd4490b22f070cd11e36b84f734a (diff)
downloaddexon-solidity-b0f2a5c162480ab6ecdc5e1397567242a137768a.tar.gz
dexon-solidity-b0f2a5c162480ab6ecdc5e1397567242a137768a.tar.zst
dexon-solidity-b0f2a5c162480ab6ecdc5e1397567242a137768a.zip
Merge pull request #2205 from ethereum/julia-strict-parser
Stricter parser for Julia
Diffstat (limited to 'libsolidity/inlineasm/AsmParser.cpp')
-rw-r--r--libsolidity/inlineasm/AsmParser.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/libsolidity/inlineasm/AsmParser.cpp b/libsolidity/inlineasm/AsmParser.cpp
index d7f78958..d9b0b3e0 100644
--- a/libsolidity/inlineasm/AsmParser.cpp
+++ b/libsolidity/inlineasm/AsmParser.cpp
@@ -84,6 +84,7 @@ assembly::Statement Parser::parseStatement()
}
case Token::Return: // opcode
case Token::Byte: // opcode
+ case Token::Address: // opcode
default:
break;
}
@@ -91,7 +92,7 @@ assembly::Statement Parser::parseStatement()
// Simple instruction (might turn into functional),
// literal,
// identifier (might turn into label or functional assignment)
- Statement statement(parseElementaryOperation());
+ Statement statement(parseElementaryOperation(false));
switch (m_scanner->currentToken())
{
case Token::LParen:
@@ -119,12 +120,16 @@ assembly::Statement Parser::parseStatement()
else
{
// label
+ if (m_julia)
+ fatalParserError("Labels are not supported.");
Label label = createWithLocation<Label>(identifier.location);
label.name = identifier.name;
return label;
}
}
default:
+ if (m_julia)
+ fatalParserError("Call or assignment expected.");
break;
}
return statement;
@@ -209,7 +214,11 @@ assembly::Statement Parser::parseElementaryOperation(bool _onlySinglePusher)
break;
}
default:
- fatalParserError("Expected elementary inline assembly operation.");
+ fatalParserError(
+ m_julia ?
+ "Literal or identifier expected." :
+ "Expected elementary inline assembly operation."
+ );
}
m_scanner->next();
return ret;
@@ -317,7 +326,11 @@ assembly::Statement Parser::parseFunctionalInstruction(assembly::Statement&& _in
return ret;
}
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 {};
}