From 2ee05c1257c916e5c804a6b565a2a6aa362050e0 Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 20 Feb 2024 21:35:03 -0800 Subject: Add wrapper type syntax for link time specialization. (#3606) * Add wrapper type syntax for link time specialization. * Cleanup. --- source/slang/slang-parser.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/slang/slang-parser.cpp') 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); -- cgit v1.2.3