diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2014-12-10 20:13:12 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2014-12-10 20:24:48 +0800 |
commit | fbc35003cee590b24bbbf8b68dad1cf4a81073c5 (patch) | |
tree | 7e83f579f063575b58ca294a02e2dc21cb817717 /AST.h | |
parent | 57e6827cb57708ed8f687bf9b0a304b1481cf742 (diff) | |
download | dexon-solidity-fbc35003cee590b24bbbf8b68dad1cf4a81073c5.tar.gz dexon-solidity-fbc35003cee590b24bbbf8b68dad1cf4a81073c5.tar.zst dexon-solidity-fbc35003cee590b24bbbf8b68dad1cf4a81073c5.zip |
Natspec title and author tag.
- Adding the title and author natspec documentation tags for contracts
- Also using the author tag for functions now
- Tests
Diffstat (limited to 'AST.h')
-rw-r--r-- | AST.h | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -146,13 +146,15 @@ class ContractDefinition: public Declaration public: ContractDefinition(Location const& _location, ASTPointer<ASTString> const& _name, + ASTPointer<ASTString> const& _documentation, std::vector<ASTPointer<StructDefinition>> const& _definedStructs, std::vector<ASTPointer<VariableDeclaration>> const& _stateVariables, std::vector<ASTPointer<FunctionDefinition>> const& _definedFunctions): Declaration(_location, _name), m_definedStructs(_definedStructs), m_stateVariables(_stateVariables), - m_definedFunctions(_definedFunctions) + m_definedFunctions(_definedFunctions), + m_documentation(_documentation) {} virtual void accept(ASTVisitor& _visitor) override; @@ -161,6 +163,10 @@ public: std::vector<ASTPointer<VariableDeclaration>> const& getStateVariables() const { return m_stateVariables; } std::vector<ASTPointer<FunctionDefinition>> const& getDefinedFunctions() const { return m_definedFunctions; } + /// @return A shared pointer of an ASTString. + /// Can contain a nullptr in which case indicates absence of documentation + ASTPointer<ASTString> const& getDocumentation() const { return m_documentation; } + /// Returns the functions that make up the calling interface in the intended order. std::vector<FunctionDefinition const*> getInterfaceFunctions() const; @@ -168,6 +174,7 @@ private: std::vector<ASTPointer<StructDefinition>> m_definedStructs; std::vector<ASTPointer<VariableDeclaration>> m_stateVariables; std::vector<ASTPointer<FunctionDefinition>> m_definedFunctions; + ASTPointer<ASTString> m_documentation; }; class StructDefinition: public Declaration |