Fix dependency checker and add unit test
This commit is contained in:
@@ -32,7 +32,7 @@ namespace Nz::ShaderAst
|
||||
|
||||
void DependencyCheckerVisitor::Visit(CallFunctionExpression& node)
|
||||
{
|
||||
const auto& targetFuncType = GetExpressionType(node);
|
||||
const auto& targetFuncType = GetExpressionType(*node.targetFunction);
|
||||
assert(std::holds_alternative<FunctionType>(targetFuncType));
|
||||
|
||||
const auto& funcType = std::get<FunctionType>(targetFuncType);
|
||||
|
||||
@@ -527,7 +527,10 @@ namespace Nz
|
||||
bool first = true;
|
||||
for (const ShaderAst::StatementPtr& statement : statements)
|
||||
{
|
||||
if (!first && statement->GetType() != ShaderAst::NodeType::NoOpStatement)
|
||||
if (statement->GetType() == ShaderAst::NodeType::NoOpStatement)
|
||||
continue;
|
||||
|
||||
if (!first)
|
||||
AppendLine();
|
||||
|
||||
statement->Visit(*this);
|
||||
|
||||
Reference in New Issue
Block a user