Revert statement.

This commit is contained in:
chriseth
2021-03-30 21:15:46 +02:00
parent b04b189959
commit fb67051467
24 changed files with 272 additions and 26 deletions
+25
View File
@@ -1726,6 +1726,31 @@ public:
void accept(ASTConstVisitor& _visitor) const override;
};
/**
* The revert statement is used to revert state changes and return error data.
*/
class RevertStatement: public Statement
{
public:
explicit RevertStatement(
int64_t _id,
SourceLocation const& _location,
ASTPointer<ASTString> const& _docString,
ASTPointer<FunctionCall> _functionCall
):
Statement(_id, _location, _docString), m_errorCall(std::move(_functionCall))
{
solAssert(m_errorCall, "");
}
void accept(ASTVisitor& _visitor) override;
void accept(ASTConstVisitor& _visitor) const override;
FunctionCall const& errorCall() const { return *m_errorCall; }
private:
ASTPointer<FunctionCall> m_errorCall;
};
/**
* The emit statement is used to emit events: emit EventName(arg1, ..., argn)
*/