diff options
author | chriseth <c@ethdev.com> | 2016-08-06 21:08:06 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-08-16 20:52:47 +0800 |
commit | 6df672816515aece1a3a9f018761450c56e05320 (patch) | |
tree | d1a81e461a09046b20bb8efb27c35547bf321073 /libsolidity/analysis/SyntaxChecker.h | |
parent | e3e4d84f3353eaaaadae7c1c6eac9e890188d0f8 (diff) | |
download | dexon-solidity-6df672816515aece1a3a9f018761450c56e05320.tar.gz dexon-solidity-6df672816515aece1a3a9f018761450c56e05320.tar.zst dexon-solidity-6df672816515aece1a3a9f018761450c56e05320.zip |
Require modifiers to contain "_".
Diffstat (limited to 'libsolidity/analysis/SyntaxChecker.h')
-rw-r--r-- | libsolidity/analysis/SyntaxChecker.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libsolidity/analysis/SyntaxChecker.h b/libsolidity/analysis/SyntaxChecker.h index c836d49f..3198ffd0 100644 --- a/libsolidity/analysis/SyntaxChecker.h +++ b/libsolidity/analysis/SyntaxChecker.h @@ -31,6 +31,7 @@ namespace solidity /** * The module that performs syntax analysis on the AST: * - whether continue/break is in a for/while loop. + * - whether a modifier contains at least one '_' */ class SyntaxChecker: private ASTConstVisitor { @@ -44,6 +45,9 @@ private: /// Adds a new error to the list of errors. void syntaxError(SourceLocation const& _location, std::string const& _description); + virtual bool visit(ModifierDefinition const& _modifier) override; + virtual void endVisit(ModifierDefinition const& _modifier) override; + virtual bool visit(WhileStatement const& _whileStatement) override; virtual void endVisit(WhileStatement const& _whileStatement) override; virtual bool visit(ForStatement const& _forStatement) override; @@ -52,8 +56,13 @@ private: virtual bool visit(Continue const& _continueStatement) override; virtual bool visit(Break const& _breakStatement) override; + virtual bool visit(PlaceholderStatement const& _placeholderStatement) override; + ErrorList& m_errors; + /// Flag that indicates whether a function modifier actually contains '_'. + bool m_placeholderFound = false; + int m_inLoopDepth = 0; }; |