Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/libraries/Microsoft.PowerFx.Core/AssemblyProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@
[assembly: InternalsVisibleTo("Microsoft.PowerFx.Json.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]

[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]

// PiFlows Server
[assembly: InternalsVisibleTo("Berry.PiFlow.Server, PublicKey=0024000004800000940000000602000000240000525341310004000001000100013b46091645a2e69cb6b4793aa9d1603c26d9a9723a68036913d487c51ce7bc1ad3ba01e42d2d88e57620515beb899b3aec91e0bc7ff97bf64b883917170c6b1360b51a2056a302db97fc425c5f26c1b7a875f3780e226b62bfc5599090e8d0eee028d40af84fc9049f8def05357ce0c38c807bd52b79d7d23d2ffb654cd6b7")]
6 changes: 5 additions & 1 deletion src/libraries/Microsoft.PowerFx.Core/Public/CheckResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,14 @@ internal TexlBinding Binding
}
}

#pragma warning disable CS1574, CS1584, CS1581, CS1580
/// <summary>
/// List of all errors and warnings. Check <see cref="ExpressionError.IsWarning"/>.
/// This can include Parse, Bind, and per-engine custom errors (see <see cref="Engine.PostCheck(CheckResult)"/>,
/// or any custom errors passes explicit to the ctor.
/// Not null, but empty on success.
/// </summary>
#pragma warning restore CS1574, CS1584, CS1581, CS1580
public IEnumerable<ExpressionError> Errors
{
get => GetErrorsInLocale(null);
Expand Down Expand Up @@ -450,12 +452,14 @@ public void ApplyDependencyAnalysis()

// Flag to ensure Post Checks are only invoked once.
private bool _invokingPostCheck;


#pragma warning disable CS1574, CS1584, CS1581, CS1580
/// <summary>
/// Calculate all errors.
/// Invoke Binding and any engine-specific errors via <see cref="Engine.PostCheck(CheckResult)"/>.
/// </summary>
/// <returns></returns>
#pragma warning restore CS1574, CS1584, CS1581, CS1580
public IEnumerable<ExpressionError> ApplyErrors()
{
if (!_invokingPostCheck)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ namespace Microsoft.PowerFx.Core.Types
{
[Flags]
[TransportType(TransportKind.Enum)]
internal enum FunctionCategories : uint
#pragma warning disable CA1028
public enum FunctionCategories : uint
#pragma warning restore CA1028
{
None = 0x0,
Text = 0x1,
Expand All @@ -20,6 +22,7 @@ internal enum FunctionCategories : uint
Information = 0x40,
Color = 0x80,
REST = 0x100,
Component = 0x200
Component = 0x200,
PiFlow = 0x400
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@

[assembly: InternalsVisibleTo("Microsoft.PowerFx.Interpreter.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
[assembly: InternalsVisibleTo("Microsoft.PowerFx.Connectors, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]

// PiFlows Server
[assembly: InternalsVisibleTo("Berry.PiFlow.Server, PublicKey=0024000004800000940000000602000000240000525341310004000001000100013b46091645a2e69cb6b4793aa9d1603c26d9a9723a68036913d487c51ce7bc1ad3ba01e42d2d88e57620515beb899b3aec91e0bc7ff97bf64b883917170c6b1360b51a2056a302db97fc425c5f26c1b7a875f3780e226b62bfc5599090e8d0eee028d40af84fc9049f8def05357ce0c38c807bd52b79d7d23d2ffb654cd6b7")]
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ namespace Microsoft.PowerFx
/// </summary>
public interface IExpressionEvaluator
{
ReadOnlySymbolValues NewFromRecordValue(RecordValue recordValue = null);

public Task<FormulaValue> EvalAsync(CancellationToken cancellationToken, IRuntimeConfig runtimeConfig = null);
}

Expand Down Expand Up @@ -137,6 +139,9 @@ async Task<FormulaValue> IExpression.EvalAsync(RecordValue parameters, Cancellat
}
}

public ReadOnlySymbolValues NewFromRecordValue(RecordValue recordValue = null) =>
ReadOnlySymbolValues.NewFromRecord(_parameterSymbolTable, recordValue);

public async Task<FormulaValue> EvalAsync(CancellationToken cancellationToken, IRuntimeConfig runtimeConfig = null)
{
ReadOnlySymbolValues symbolValues = ComposedReadOnlySymbolValues.New(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,26 @@ public CustomTexlFunction(string name, DType returnType, params DType[] paramTyp
{
}

protected CustomTexlFunction(
string name,
string description,
FunctionCategories functionCategories,
FormulaType returnType,
params FormulaType[] paramTypes)
: base(
DPath.Root,
name,
name,
SG(description),
functionCategories,
returnType._type,
0,
paramTypes.Length,
paramTypes.Length,
Array.ConvertAll(paramTypes, p => p._type))
{
}

public override bool IsSelfContained => true;

public static StringGetter SG(string text)
Expand Down Expand Up @@ -137,7 +157,7 @@ public async Task<FormulaValue> InvokeAsync(FormulaValue[] args, CancellationTok
return await result;
}
}

/// <summary>
/// Base class for importing a C# function into Power Fx.
/// Dervied class should follow this convention:
Expand Down