Add DeclarationAnnotation

This commit is contained in:
Jason Cobb
2019-12-19 21:45:16 -05:00
parent bc71f61467
commit be14d5f28d
3 changed files with 13 additions and 0 deletions
+7
View File
@@ -449,6 +449,13 @@ string Scopable::sourceUnitName() const
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
{
// Constant declared variables are Read-Only