diff options
author | chriseth <chris@ethereum.org> | 2018-07-10 23:50:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-10 23:50:02 +0800 |
commit | 0e9415bc31fa379b2c6cc8c8dba6b6ba1305391b (patch) | |
tree | 4b946283078b1f9367c96bf2cc9d891f32cf475f /libsolidity/ast/AST.h | |
parent | dce0da1d1763f8ff96e05c603acf37f03937e079 (diff) | |
parent | 187eef36ad6e7c127fdeeaba519c88cd399ec79a (diff) | |
download | dexon-solidity-0e9415bc31fa379b2c6cc8c8dba6b6ba1305391b.tar.gz dexon-solidity-0e9415bc31fa379b2c6cc8c8dba6b6ba1305391b.tar.zst dexon-solidity-0e9415bc31fa379b2c6cc8c8dba6b6ba1305391b.zip |
Merge pull request #4468 from ethereum/variableDeclarationClenaup
Remove mentions of ``var`` in VariableDeclarationStatement comment.
Diffstat (limited to 'libsolidity/ast/AST.h')
-rw-r--r-- | libsolidity/ast/AST.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/libsolidity/ast/AST.h b/libsolidity/ast/AST.h index d703ae53..9906fa68 100644 --- a/libsolidity/ast/AST.h +++ b/libsolidity/ast/AST.h @@ -1250,13 +1250,12 @@ private: }; /** - * Definition of a variable as a statement inside a function. It requires a type name (which can - * also be "var") but the actual assignment can be missing. - * Examples: var a = 2; uint256 a; - * As a second form, multiple variables can be declared, cannot have a type and must be assigned - * right away. If the first or last component is unnamed, it can "consume" an arbitrary number - * of components. - * Examples: var (a, b) = f(); var (a,,,c) = g(); var (a,) = d(); + * Definition of one or more variables as a statement inside a function. + * If multiple variables are declared, a value has to be assigned directly. + * If only a single variable is declared, the value can be missing. + * Examples: + * uint[] memory a; uint a = 2; + * (uint a, bytes32 b, ) = f(); (, uint a, , StructName storage x) = g(); */ class VariableDeclarationStatement: public Statement { @@ -1278,6 +1277,9 @@ public: private: /// List of variables, some of which can be empty pointers (unnamed components). + /// Note that the ``m_value`` member of these is unused. Instead, ``m_initialValue`` + /// below is used, because the initial value can be a single expression assigned + /// to all variables. std::vector<ASTPointer<VariableDeclaration>> m_variables; /// The assigned expression / initial value. ASTPointer<Expression> m_initialValue; |