summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-syntax.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-syntax.cpp')
-rw-r--r--source/slang/slang-syntax.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/source/slang/slang-syntax.cpp b/source/slang/slang-syntax.cpp
index d479ba32a..1dcaafec5 100644
--- a/source/slang/slang-syntax.cpp
+++ b/source/slang/slang-syntax.cpp
@@ -1280,6 +1280,35 @@ void Type::accept(IValVisitor* visitor, void* extra)
return this;
}
+ // NamespaceType
+
+ String NamespaceType::ToString()
+ {
+ String result;
+ result.append("namespace ");
+ result.append(m_declRef.toString());
+ return result;
+ }
+
+ bool NamespaceType::EqualsImpl(Type * type)
+ {
+ if (auto namespaceType = as<NamespaceType>(type))
+ {
+ return m_declRef.Equals(namespaceType->m_declRef);
+ }
+ return false;
+ }
+
+ int NamespaceType::GetHashCode()
+ {
+ return m_declRef.GetHashCode();
+ }
+
+ RefPtr<Type> NamespaceType::CreateCanonicalType()
+ {
+ return this;
+ }
+
// ArithmeticExpressionType
// VectorExpressionType
@@ -2301,6 +2330,16 @@ void Type::accept(IValVisitor* visitor, void* extra)
return genericDeclRefType;
}
+ RefPtr<NamespaceType> getNamespaceType(
+ Session* session,
+ DeclRef<NamespaceDeclBase> const& declRef)
+ {
+ auto type = new NamespaceType;
+ type->setSession(session);
+ type->m_declRef = declRef;
+ return type;
+ }
+
RefPtr<SamplerStateType> getSamplerStateType(
Session* session)
{