ShaderNode: Add automatic variables

This commit is contained in:
Lynix
2020-05-26 20:30:24 +02:00
parent 09e08255fb
commit d96bc9db6e
12 changed files with 143 additions and 19 deletions

View File

@@ -82,11 +82,14 @@ namespace Nz
{
}
inline AssignOp::AssignOp(AssignType Op, VariablePtr Var, ExpressionPtr Right) :
inline AssignOp::AssignOp(AssignType Op, ExpressionPtr Left, ExpressionPtr Right) :
op(Op),
variable(std::move(Var)),
left(std::move(Left)),
right(std::move(Right))
{
if (left->GetExpressionCategory() != ExpressionCategory::LValue)
//TODO: AstParseError
throw std::runtime_error("Assignation is only possible with lvalues");
}
inline BinaryOp::BinaryOp(BinaryType Op, ExpressionPtr Left, ExpressionPtr Right) :