mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Store docstrings in AST annotations.
This commit is contained in:
@@ -41,13 +41,26 @@ struct ASTAnnotation
|
||||
virtual ~ASTAnnotation() {}
|
||||
};
|
||||
|
||||
struct DocTag
|
||||
{
|
||||
std::string content; ///< The text content of the tag.
|
||||
std::string paramName; ///< Only used for @param, stores the parameter name.
|
||||
};
|
||||
|
||||
struct DocumentedAnnotation
|
||||
{
|
||||
virtual ~DocumentedAnnotation() {}
|
||||
/// Mapping docstring tag name -> content.
|
||||
std::multimap<std::string, DocTag> docTags;
|
||||
};
|
||||
|
||||
struct TypeDeclarationAnnotation: ASTAnnotation
|
||||
{
|
||||
/// The name of this type, prefixed by proper namespaces if globally accessible.
|
||||
std::string canonicalName;
|
||||
};
|
||||
|
||||
struct ContractDefinitionAnnotation: TypeDeclarationAnnotation
|
||||
struct ContractDefinitionAnnotation: TypeDeclarationAnnotation, DocumentedAnnotation
|
||||
{
|
||||
/// Whether all functions are implemented.
|
||||
bool isFullyImplemented = true;
|
||||
@@ -59,6 +72,18 @@ struct ContractDefinitionAnnotation: TypeDeclarationAnnotation
|
||||
std::set<ContractDefinition const*> contractDependencies;
|
||||
};
|
||||
|
||||
struct FunctionDefinitionAnnotation: ASTAnnotation, DocumentedAnnotation
|
||||
{
|
||||
};
|
||||
|
||||
struct EventDefinitionAnnotation: ASTAnnotation, DocumentedAnnotation
|
||||
{
|
||||
};
|
||||
|
||||
struct ModifierDefinitionAnnotation: ASTAnnotation, DocumentedAnnotation
|
||||
{
|
||||
};
|
||||
|
||||
struct VariableDeclarationAnnotation: ASTAnnotation
|
||||
{
|
||||
/// Type of variable (type of identifier referencing this variable).
|
||||
|
||||
Reference in New Issue
Block a user