LibCpp: Differentiate between Type and NamedType

This adds a new ASTNode type called 'NamedType' which inherits from
the Type node.

Previously every Type node had a name field, but it was not logically
accurate. For example, pointer types do not have a name
(the pointed-to type may have one).
This commit is contained in:
Itamar 2021-06-26 15:34:23 +03:00 committed by Ali Mohammad Pur
commit d7aa831a43
Notes: sideshowbarker 2024-07-18 11:23:22 +09:00
5 changed files with 55 additions and 29 deletions

View file

@ -75,7 +75,7 @@ void Type::dump(FILE* output, size_t indent) const
outln(output, "{}", to_string());
}
String Type::to_string() const
String NamedType::to_string() const
{
String qualifiers_string;
if (!m_qualifiers.is_empty())