diff options
Diffstat (limited to 'libsolidity/analysis/SyntaxChecker.cpp')
-rw-r--r-- | libsolidity/analysis/SyntaxChecker.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/libsolidity/analysis/SyntaxChecker.cpp b/libsolidity/analysis/SyntaxChecker.cpp index e94ce9fe..593f2f69 100644 --- a/libsolidity/analysis/SyntaxChecker.cpp +++ b/libsolidity/analysis/SyntaxChecker.cpp @@ -40,13 +40,26 @@ void SyntaxChecker::syntaxError(SourceLocation const& _location, std::string con m_errors.push_back(err); } +bool SyntaxChecker::visit(ModifierDefinition const&) +{ + m_placeholderFound = false; + return true; +} + +void SyntaxChecker::endVisit(ModifierDefinition const& _modifier) +{ + if (!m_placeholderFound) + syntaxError(_modifier.body().location(), "Modifier body does not contain '_'."); + m_placeholderFound = false; +} + bool SyntaxChecker::visit(WhileStatement const&) { m_inLoopDepth++; return true; } -void SyntaxChecker::endVisit(WhileStatement const&) +void SyntaxChecker::endVisit(WhileStatement const& ) { m_inLoopDepth--; } @@ -78,3 +91,9 @@ bool SyntaxChecker::visit(Break const& _breakStatement) return true; } +bool SyntaxChecker::visit(const PlaceholderStatement&) +{ + m_placeholderFound = true; + return true; +} + |