mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Revert statement.
This commit is contained in:
@@ -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)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user