diff options
author | Rhett Aultman <roadriverrail@gmail.com> | 2016-07-30 15:13:05 +0800 |
---|---|---|
committer | Rhett Aultman <roadriverrail@gmail.com> | 2016-11-10 23:07:25 +0800 |
commit | 4524ad08701939cc22d28494c57dda1cdfba9e10 (patch) | |
tree | 70ff8928bf6a84f50e2ca54d355be81db01e7bcd /libsolidity/ast/AST.h | |
parent | dc8a5f4ef5505f2aeb017dfa4c9aca77a9fd93aa (diff) | |
download | dexon-solidity-4524ad08701939cc22d28494c57dda1cdfba9e10.tar dexon-solidity-4524ad08701939cc22d28494c57dda1cdfba9e10.tar.gz dexon-solidity-4524ad08701939cc22d28494c57dda1cdfba9e10.tar.bz2 dexon-solidity-4524ad08701939cc22d28494c57dda1cdfba9e10.tar.lz dexon-solidity-4524ad08701939cc22d28494c57dda1cdfba9e10.tar.xz dexon-solidity-4524ad08701939cc22d28494c57dda1cdfba9e10.tar.zst dexon-solidity-4524ad08701939cc22d28494c57dda1cdfba9e10.zip |
Add support for do/while loops
This commit adds support for a standard do <statement> while <expr>;
form of statement. While loops were already being supported; supporting
a do/while loop mostly involves reusing code from while loops but putting
the conditional checking last.
Diffstat (limited to 'libsolidity/ast/AST.h')
-rw-r--r-- | libsolidity/ast/AST.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libsolidity/ast/AST.h b/libsolidity/ast/AST.h index 7ed4ddce..6c3f52bc 100644 --- a/libsolidity/ast/AST.h +++ b/libsolidity/ast/AST.h @@ -1005,18 +1005,22 @@ public: SourceLocation const& _location, ASTPointer<ASTString> const& _docString, ASTPointer<Expression> const& _condition, - ASTPointer<Statement> const& _body + ASTPointer<Statement> const& _body, + bool _isDoWhile ): - BreakableStatement(_location, _docString), m_condition(_condition), m_body(_body) {} + BreakableStatement(_location, _docString), m_condition(_condition), m_body(_body), + m_isDoWhile(_isDoWhile) {} virtual void accept(ASTVisitor& _visitor) override; virtual void accept(ASTConstVisitor& _visitor) const override; Expression const& condition() const { return *m_condition; } Statement const& body() const { return *m_body; } + bool isDoWhile() const { return m_isDoWhile; } private: ASTPointer<Expression> m_condition; ASTPointer<Statement> m_body; + bool m_isDoWhile; }; /** |