summaryrefslogtreecommitdiffstats
path: root/source/slang/syntax.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/syntax.cpp')
-rw-r--r--source/slang/syntax.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/source/slang/syntax.cpp b/source/slang/syntax.cpp
index e43dd9074..badfaea4f 100644
--- a/source/slang/syntax.cpp
+++ b/source/slang/syntax.cpp
@@ -1709,7 +1709,22 @@ void Type::accept(IValVisitor* visitor, void* extra)
return sb.ProduceString();
}
-
+ void insertSubstAtBottom(RefPtr<Substitutions> & substHead, RefPtr<Substitutions> substToInsert)
+ {
+ if (!substHead)
+ {
+ substHead = substToInsert;
+ return;
+ }
+ auto subst = substHead;
+ RefPtr<Substitutions> lastSubst = subst;
+ while (subst->outer)
+ {
+ lastSubst = subst;
+ subst = subst->outer;
+ }
+ lastSubst->outer = substToInsert;
+ }
void insertSubstAtTop(DeclRefBase & declRef, RefPtr<Substitutions> substToInsert)
{