aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis/SyntaxChecker.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-08-06 21:08:06 +0800
committerchriseth <c@ethdev.com>2016-08-16 20:52:47 +0800
commit6df672816515aece1a3a9f018761450c56e05320 (patch)
treed1a81e461a09046b20bb8efb27c35547bf321073 /libsolidity/analysis/SyntaxChecker.cpp
parente3e4d84f3353eaaaadae7c1c6eac9e890188d0f8 (diff)
downloaddexon-solidity-6df672816515aece1a3a9f018761450c56e05320.tar.gz
dexon-solidity-6df672816515aece1a3a9f018761450c56e05320.tar.zst
dexon-solidity-6df672816515aece1a3a9f018761450c56e05320.zip
Require modifiers to contain "_".
Diffstat (limited to 'libsolidity/analysis/SyntaxChecker.cpp')
-rw-r--r--libsolidity/analysis/SyntaxChecker.cpp21
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;
+}
+