summaryrefslogtreecommitdiffstats
path: root/source/slang/check.cpp
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2017-07-06 09:52:53 -0700
committerGitHub <noreply@github.com>2017-07-06 09:52:53 -0700
commit21a14cb4e0d578bc4f8a460016269a1199cac0da (patch)
tree88a04619ceaaa37b87199dd82334cc9d102c156d /source/slang/check.cpp
parentf313df379dd9e0d4395f072ffb87016a6f20d5a1 (diff)
parentf145e09a6dcbcf326f782b3e6a76dbf291c792cf (diff)
Merge pull request #53 from tfoleyNV/cross-compilation
Initial work on cross-compilation
Diffstat (limited to 'source/slang/check.cpp')
-rw-r--r--source/slang/check.cpp29
1 files changed, 26 insertions, 3 deletions
diff --git a/source/slang/check.cpp b/source/slang/check.cpp
index a3e061a3b..a79af3f37 100644
--- a/source/slang/check.cpp
+++ b/source/slang/check.cpp
@@ -1581,11 +1581,16 @@ namespace Slang
DeclVisitor::dispatch(stmt->decl);
}
- void visit(BlockStatementSyntaxNode *stmt)
+ void visit(BlockStmt* stmt)
{
- for (auto & node : stmt->Statements)
+ checkStmt(stmt->body);
+ }
+
+ void visit(SeqStmt* stmt)
+ {
+ for(auto ss : stmt->stmts)
{
- checkStmt(node);
+ checkStmt(ss);
}
}
@@ -2414,6 +2419,24 @@ namespace Slang
return appExpr;
}
+ //
+
+ RefPtr<ExpressionSyntaxNode> visit(AssignExpr* expr)
+ {
+ expr->left = CheckExpr(expr->left);
+
+ auto type = expr->left->Type;
+
+ expr->right = Coerce(type, CheckTerm(expr->right));
+
+ if (!type.IsLeftValue)
+ {
+ getSink()->diagnose(expr, Diagnostics::assignNonLValue);
+ }
+ expr->Type = type;
+ return expr;
+ }
+
//