aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/analysis/SyntaxChecker.h
diff options
context:
space:
mode:
authorLeonardo Alt <leo@ethereum.org>2018-09-04 00:17:59 +0800
committerLeonardo Alt <leo@ethereum.org>2018-09-04 00:21:57 +0800
commit4522c804f342707ec2bb86a19735a4084108d96d (patch)
treeccd25ee49fc27fdf0bc041f07d7a242d7b5ab25f /libsolidity/analysis/SyntaxChecker.h
parent6e5e05779c6085c1fc58d38390cc5cb447068ecb (diff)
downloaddexon-solidity-4522c804f342707ec2bb86a19735a4084108d96d.tar.gz
dexon-solidity-4522c804f342707ec2bb86a19735a4084108d96d.tar.zst
dexon-solidity-4522c804f342707ec2bb86a19735a4084108d96d.zip
Disallow single statement var decl in if/while/for without blocks
Diffstat (limited to 'libsolidity/analysis/SyntaxChecker.h')
-rw-r--r--libsolidity/analysis/SyntaxChecker.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/libsolidity/analysis/SyntaxChecker.h b/libsolidity/analysis/SyntaxChecker.h
index 897df676..27d98401 100644
--- a/libsolidity/analysis/SyntaxChecker.h
+++ b/libsolidity/analysis/SyntaxChecker.h
@@ -52,6 +52,12 @@ private:
virtual bool visit(ModifierDefinition const& _modifier) override;
virtual void endVisit(ModifierDefinition const& _modifier) override;
+ // Reports an error if _statement is a VariableDeclarationStatement.
+ // Used by if/while/for to check for single statement variable declarations
+ // without a block.
+ void checkSingleStatementVariableDeclaration(ASTNode const* _statement);
+
+ virtual bool visit(IfStatement const& _ifStatement) override;
virtual bool visit(WhileStatement const& _whileStatement) override;
virtual void endVisit(WhileStatement const& _whileStatement) override;
virtual bool visit(ForStatement const& _forStatement) override;