mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #1181 from ethereum/formal_ignore_pragma
formal: ignore pragmas during Why3 code generation
This commit is contained in:
commit
821fe6e916
@ -757,6 +757,20 @@ bool Why3Translator::visit(Literal const& _literal)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Why3Translator::visit(PragmaDirective const& _pragma)
|
||||
{
|
||||
if (_pragma.tokens().empty())
|
||||
error(_pragma, "Not supported");
|
||||
else if (_pragma.literals().empty())
|
||||
error(_pragma, "Not supported");
|
||||
else if (_pragma.literals()[0] != "solidity")
|
||||
error(_pragma, "Not supported");
|
||||
else if (_pragma.tokens()[0] != Token::Identifier)
|
||||
error(_pragma, "A literal 'solidity' is not an identifier. Strange");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Why3Translator::isStateVariable(VariableDeclaration const* _var) const
|
||||
{
|
||||
return contains(m_currentContract.stateVariables, _var);
|
||||
|
@ -94,6 +94,7 @@ private:
|
||||
virtual bool visit(IndexAccess const& _node) override;
|
||||
virtual bool visit(Identifier const& _node) override;
|
||||
virtual bool visit(Literal const& _node) override;
|
||||
virtual bool visit(PragmaDirective const& _node) override;
|
||||
|
||||
virtual bool visitNode(ASTNode const& _node) override
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user