diff options
author | Christian <c@ethdev.com> | 2014-11-13 08:12:57 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2014-11-14 21:08:14 +0800 |
commit | c560a62352b8ba1a106ec06aedf779df06af3a22 (patch) | |
tree | 325f19538a1239529e68d0126341e0f6aa655ef7 /NameAndTypeResolver.h | |
parent | 46dd62982084dfe5712292b88047d2a58e0a420e (diff) | |
download | dexon-solidity-c560a62352b8ba1a106ec06aedf779df06af3a22.tar.gz dexon-solidity-c560a62352b8ba1a106ec06aedf779df06af3a22.tar.zst dexon-solidity-c560a62352b8ba1a106ec06aedf779df06af3a22.zip |
Struct types.
Diffstat (limited to 'NameAndTypeResolver.h')
-rw-r--r-- | NameAndTypeResolver.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/NameAndTypeResolver.h b/NameAndTypeResolver.h index 90902494..d335807e 100644 --- a/NameAndTypeResolver.h +++ b/NameAndTypeResolver.h @@ -55,10 +55,13 @@ public: Declaration* getNameFromCurrentScope(ASTString const& _name, bool _recursive = true); private: + /// Throws if @a _struct contains a recursive loop. Note that recursion via mappings is fine. + void checkForRecursion(StructDefinition const& _struct); void reset(); - /// Maps nodes declaring a scope to scopes, i.e. ContractDefinition, FunctionDeclaration and - /// StructDefinition (@todo not yet implemented), where nullptr denotes the global scope. + /// Maps nodes declaring a scope to scopes, i.e. ContractDefinition and FunctionDeclaration, + /// where nullptr denotes the global scope. Note that structs are not scope since they do + /// not contain code. std::map<ASTNode const*, Scope> m_scopes; Scope* m_currentScope; @@ -99,7 +102,8 @@ private: class ReferencesResolver: private ASTVisitor { public: - ReferencesResolver(ASTNode& _root, NameAndTypeResolver& _resolver, ParameterList* _returnParameters); + ReferencesResolver(ASTNode& _root, NameAndTypeResolver& _resolver, + ParameterList* _returnParameters, bool _allowLazyTypes = true); private: virtual void endVisit(VariableDeclaration& _variable) override; @@ -110,6 +114,7 @@ private: NameAndTypeResolver& m_resolver; ParameterList* m_returnParameters; + bool m_allowLazyTypes; }; } |