Skip to content

Commit

Permalink
Draft
Browse files Browse the repository at this point in the history
  • Loading branch information
anderson-joyle committed Jan 22, 2025
1 parent f0af967 commit dc7d11b
Show file tree
Hide file tree
Showing 14 changed files with 823 additions and 15 deletions.
36 changes: 36 additions & 0 deletions src/libraries/Microsoft.PowerFx.Core/Functions/TexlFunction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using Microsoft.PowerFx.Core.Functions.FunctionArgValidators;
using Microsoft.PowerFx.Core.Functions.Publish;
using Microsoft.PowerFx.Core.Functions.TransportSchemas;
using Microsoft.PowerFx.Core.IR;
using Microsoft.PowerFx.Core.IR.Nodes;
using Microsoft.PowerFx.Core.IR.Symbols;
using Microsoft.PowerFx.Core.Localization;
Expand All @@ -31,6 +32,7 @@
using Microsoft.PowerFx.Intellisense;
using Microsoft.PowerFx.Syntax;
using Microsoft.PowerFx.Types;
using static Microsoft.PowerFx.Core.IR.DependencyVisitor;
using static Microsoft.PowerFx.Core.IR.IRTranslator;
using CallNode = Microsoft.PowerFx.Syntax.CallNode;
using IRCallNode = Microsoft.PowerFx.Core.IR.Nodes.CallNode;
Expand Down Expand Up @@ -1738,5 +1740,39 @@ internal ArgPreprocessor GetGenericArgPreprocessor(int index)

return ArgPreprocessor.None;
}

/// <summary>
/// Visit all function nodes to compose dependency info.
/// </summary>
/// <param name="node">IR CallNode.</param>
/// <param name="visitor">Dependency visitor.</param>
/// <param name="context">Dependency context.</param>
/// <returns>Static boolean value.</returns>
public virtual bool ComposeDependencyInfo(IRCallNode node, DependencyVisitor visitor, DependencyContext context)
{
for (int i = 0; i < node.Args.Count; i++)
{
if (node.Scope != null && i < node.Function.ScopeArgs)
{
if (node.Args[i] is IRCallNode callNode)
{
callNode.Accept(visitor, context);
}
else
{
continue;
}
}
else
{
node.Args[i].Accept(visitor, context);
}
}

// The return value is used by DepedencyScanFunctionTests test case.
// Returning false to indicate that the function runs a basic dependency scan.
// Other functions can override this method to return true if they have a custom dependency scan.
return false;
}
}
}
Loading

0 comments on commit dc7d11b

Please sign in to comment.