diff options
author | Rhett Aultman <roadriverrail@gmail.com> | 2017-04-29 08:43:19 +0800 |
---|---|---|
committer | Rhett Aultman <roadriverrail@gmail.com> | 2017-04-29 08:43:19 +0800 |
commit | e544698ad3a2101e3d910d0761571d4fa20144e8 (patch) | |
tree | 05195e18c017d61f873a74b3fbc28fdea969b30e /libsolidity/analysis/SyntaxChecker.h | |
parent | f33614e1f7c85126b8f1a6d007f5824f6dce237d (diff) | |
download | dexon-solidity-e544698ad3a2101e3d910d0761571d4fa20144e8.tar.gz dexon-solidity-e544698ad3a2101e3d910d0761571d4fa20144e8.tar.zst dexon-solidity-e544698ad3a2101e3d910d0761571d4fa20144e8.zip |
Deprecate use of unary '+'
The unary '+' serves no meaningful purpose in Solidity and it makes it
possible to produce typos with dagerous implications (e.g. 'a =+5 '),
so we are deprecating it. The SyntaxChecker currently issues warnings
on the unary '+' but will still compile it for now.
Diffstat (limited to 'libsolidity/analysis/SyntaxChecker.h')
-rw-r--r-- | libsolidity/analysis/SyntaxChecker.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libsolidity/analysis/SyntaxChecker.h b/libsolidity/analysis/SyntaxChecker.h index 308e128b..8d7dcdd3 100644 --- a/libsolidity/analysis/SyntaxChecker.h +++ b/libsolidity/analysis/SyntaxChecker.h @@ -32,6 +32,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 '_' + * - issues deprecation warnings for unary '+' */ class SyntaxChecker: private ASTConstVisitor { @@ -43,6 +44,7 @@ public: private: /// Adds a new error to the list of errors. + void warning(SourceLocation const& _location, std::string const& _description); void syntaxError(SourceLocation const& _location, std::string const& _description); virtual bool visit(SourceUnit const& _sourceUnit) override; @@ -60,6 +62,8 @@ private: virtual bool visit(Continue const& _continueStatement) override; virtual bool visit(Break const& _breakStatement) override; + virtual bool visit(UnaryOperation const& _operation) override; + virtual bool visit(PlaceholderStatement const& _placeholderStatement) override; ErrorList& m_errors; |