mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add DeclarationAnnotation
This commit is contained in:
parent
bc71f61467
commit
be14d5f28d
@ -449,6 +449,13 @@ string Scopable::sourceUnitName() const
|
|||||||
return sourceUnit().annotation().path;
|
return sourceUnit().annotation().path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DeclarationAnnotation& Declaration::annotation() const
|
||||||
|
{
|
||||||
|
if (!m_annotation)
|
||||||
|
m_annotation = make_unique<DeclarationAnnotation>();
|
||||||
|
return dynamic_cast<DeclarationAnnotation&>(*m_annotation);
|
||||||
|
}
|
||||||
|
|
||||||
bool VariableDeclaration::isLValue() const
|
bool VariableDeclaration::isLValue() const
|
||||||
{
|
{
|
||||||
// Constant declared variables are Read-Only
|
// Constant declared variables are Read-Only
|
||||||
|
@ -231,6 +231,8 @@ public:
|
|||||||
/// @returns null when it is not accessible as a function.
|
/// @returns null when it is not accessible as a function.
|
||||||
virtual FunctionTypePointer functionType(bool /*_internal*/) const { return {}; }
|
virtual FunctionTypePointer functionType(bool /*_internal*/) const { return {}; }
|
||||||
|
|
||||||
|
DeclarationAnnotation& annotation() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual Visibility defaultVisibility() const { return Visibility::Public; }
|
virtual Visibility defaultVisibility() const { return Visibility::Public; }
|
||||||
|
|
||||||
|
@ -82,6 +82,10 @@ struct ScopableAnnotation
|
|||||||
ASTNode const* scope = nullptr;
|
ASTNode const* scope = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct DeclarationAnnotation: ASTAnnotation, ScopableAnnotation
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
struct ImportAnnotation: ASTAnnotation
|
struct ImportAnnotation: ASTAnnotation
|
||||||
{
|
{
|
||||||
/// The absolute path of the source unit to import.
|
/// The absolute path of the source unit to import.
|
||||||
|
Loading…
Reference in New Issue
Block a user