summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-parser.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-02-20 21:35:03 -0800
committerGitHub <noreply@github.com>2024-02-20 21:35:03 -0800
commit2ee05c1257c916e5c804a6b565a2a6aa362050e0 (patch)
treeeab2a825afa5b8b48f62b5e6fd513f16a9e754e7 /source/slang/slang-parser.cpp
parenta62be597990966b9516995650baf750ee6a0146b (diff)
Add wrapper type syntax for link time specialization. (#3606)
* Add wrapper type syntax for link time specialization. * Cleanup.
Diffstat (limited to 'source/slang/slang-parser.cpp')
-rw-r--r--source/slang/slang-parser.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/slang/slang-parser.cpp b/source/slang/slang-parser.cpp
index b89b93138..b208e1098 100644
--- a/source/slang/slang-parser.cpp
+++ b/source/slang/slang-parser.cpp
@@ -4733,6 +4733,14 @@ namespace Slang
// We allow for an inheritance clause on a `struct`
// so that it can conform to interfaces.
parseOptionalInheritanceClause(this, rs);
+ if (AdvanceIf(this, TokenType::OpAssign))
+ {
+ rs->wrappedType = ParseTypeExp();
+ PushScope(rs);
+ PopScope();
+ ReadToken(TokenType::Semicolon);
+ return rs;
+ }
if (AdvanceIf(this, TokenType::Semicolon))
return rs;
parseDeclBody(this, rs);