summaryrefslogtreecommitdiffstats
path: root/source/slang/emit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/emit.cpp')
-rw-r--r--source/slang/emit.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/slang/emit.cpp b/source/slang/emit.cpp
index d433d5e2f..2e8ab58d4 100644
--- a/source/slang/emit.cpp
+++ b/source/slang/emit.cpp
@@ -2395,6 +2395,17 @@ struct EmitVisitor
if(needClose) Emit(")");
}
+ void visitThisExpr(ThisExpr* expr, ExprEmitArg const& arg)
+ {
+ auto prec = kEOp_Atomic;
+ auto outerPrec = arg.outerPrec;
+ bool needClose = MaybeEmitParens(outerPrec, prec);
+
+ Emit("this");
+
+ if(needClose) Emit(")");
+ }
+
void visitSwizzleExpr(SwizzleExpr* swizExpr, ExprEmitArg const& arg)
{
auto prec = kEOp_Postfix;