diff --git a/lib/include/artichoke/Parser/AST/AST.hpp b/lib/include/artichoke/Parser/AST/AST.hpp index a53c54f..c44d640 100644 --- a/lib/include/artichoke/Parser/AST/AST.hpp +++ b/lib/include/artichoke/Parser/AST/AST.hpp @@ -23,4 +23,9 @@ namespace arti::lang::ast { Vector declarations; }; + template + auto MakeNode() { + return std::make_unique(); + } + } // namespace arti::lang::ast diff --git a/lib/include/artichoke/Parser/AST/Common.hpp b/lib/include/artichoke/Parser/AST/Common.hpp index 4ce90d0..107cdd7 100644 --- a/lib/include/artichoke/Parser/AST/Common.hpp +++ b/lib/include/artichoke/Parser/AST/Common.hpp @@ -74,4 +74,10 @@ namespace arti::lang::ast { template using Vector = std::vector; + template + concept ASTNodePtr = requires { + typename Node::element_type; + requires std::is_same_v, Node>; + }; + } // namespace arti::lang::ast diff --git a/lib/include/artichoke/Parser/AST/Types.hpp b/lib/include/artichoke/Parser/AST/Types.hpp index fd4560d..f3bf72e 100644 --- a/lib/include/artichoke/Parser/AST/Types.hpp +++ b/lib/include/artichoke/Parser/AST/Types.hpp @@ -57,6 +57,13 @@ namespace arti::lang::ast { struct nodes::NamespacedType { SourceLocation location; + String typeName; + TypeExpressionNode baseType; + }; + + struct nodes::NamespacedIdentifier { + SourceLocation location; + Vector identParts; };