mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Assert integrity of empty IndexAccessPath structure.
This commit is contained in:
parent
be54f48197
commit
fe8f38a7a4
@ -1098,6 +1098,16 @@ ASTPointer<Statement> Parser::parseSimpleStatement(ASTPointer<ASTString> const&
|
||||
}
|
||||
}
|
||||
|
||||
bool Parser::IndexAccessedPath::empty() const
|
||||
{
|
||||
if (!indices.empty())
|
||||
{
|
||||
solAssert(!path.empty(), "");
|
||||
}
|
||||
return path.empty() && indices.empty();
|
||||
}
|
||||
|
||||
|
||||
pair<Parser::LookAheadInfo, Parser::IndexAccessedPath> Parser::tryParseIndexAccessedPath()
|
||||
{
|
||||
// These two cases are very hard to distinguish:
|
||||
|
@ -151,7 +151,7 @@ private:
|
||||
{
|
||||
std::vector<ASTPointer<PrimaryExpression>> path;
|
||||
std::vector<std::pair<ASTPointer<Expression>, SourceLocation>> indices;
|
||||
bool empty() const { return path.empty() && indices.empty(); }
|
||||
bool empty() const;
|
||||
};
|
||||
|
||||
std::pair<LookAheadInfo, IndexAccessedPath> tryParseIndexAccessedPath();
|
||||
|
Loading…
Reference in New Issue
Block a user