Refactor expression configuration by separating immutable parsing/evaluation settings from runtime expression context by @gumbarros in #600
Add ExpressionConfiguration, ExpressionEvaluationOptions for explicit configuration.
Add FloatingPointNumberType and IntegerNumberType to configure parser number handling and string-to-number coercion in math helpers.
Improve parser caching by including culture in the parser cache key.
Refactor: Generate type-aware comparisons and optimize common numeric paths by @gumbarros in #601
Fix serialization of floating-point numbers by @gumbarros in #605
Breaking Changes
ExpressionContext now represents only per-evaluation runtime state. StaticParameters was renamed to Parameters, and Options, CultureInfo, MathHelperOptions, ComparisonOptions, and the implicit conversions from ExpressionOptions/CultureInfo were removed. Configure parsing and evaluation with ExpressionConfiguration instead.
ExpressionContext is no longer a record and all props are init only to incentive immutability.
Expression.Options no longer exposes the getter. It is kept only as a setter that replaces Expression.Configuration using ExpressionConfiguration.FromOptions(...). Use Expression.Configuration, Expression.ParserOptions, Expression.EvaluationOptions, Expression.CultureInfo, and Expression.Configuration.CacheEnabled.
Expression constructors and IExpressionFactory.Create now accept ExpressionConfiguration and CultureInfo.
Parameters, DynamicParameters, AsyncParameters, Functions, and AsyncFunctions on Expression no longer have setters. Mutate the dictionaries on Expression.Context or replace them through a new ExpressionContext.
LogicalExpressionArgumentSeparator was renamed to ArgumentSeparator.
LogicalExpressionParserOptions no longer exposes DecimalAsDefault and LongAsDefault. Use FloatingPointNumberType and IntegerNumberType.
LogicalExpressionParser.GetOrCreateExpressionParser now requires a CultureInfo, and LogicalExpressionParser.Parse accepts culture separately from parser options.
ILogicalExpressionFactory.Create now accepts LogicalExpressionParserOptions? and CultureInfo? instead of ExpressionOptions.
IEvaluationVisitorFactory, EvaluationVisitor, and AsyncEvaluationVisitor now require ExpressionEvaluationOptions and CultureInfo.
LogicalExpression extension methods Evaluate(...) and EvaluateAsync(...) were removed. Evaluate through Expression or instantiate the appropriate evaluation visitor.
ComparisonOptions was removed. Use StringComparer property.
MathHelperOptions was renamed to MathOptions.
LogicalExpressionParserContext was renamed to LogicalExpressionParseContext following Parlot convention
The NCalc.Antlr package/plugin was removed. Use the default Parlot parser or provide a custom ILogicalExpressionFactory.
Configuration
📅Schedule: (UTC)
Branch creation
At any time (no schedule defined)
Automerge
At any time (no schedule defined)
🚦Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕Ignore: Close this PR and you won't be reminded about this update again.
If you want to rebase/retry this PR, check this box
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [NCalcSync](https://github.com/ncalc/ncalc) | nuget | major | `6.4.0` → `7.0.0` |
---
### Release Notes
<details>
<summary>ncalc/ncalc (NCalcSync)</summary>
### [`v7.0.0`](https://github.com/ncalc/ncalc/blob/HEAD/CHANGELOG.md#700)
- Refactor expression configuration by separating immutable parsing/evaluation settings from runtime expression context by [@​gumbarros](https://github.com/gumbarros) in [#​600](https://github.com/ncalc/ncalc/pull/600)
- Add `ExpressionConfiguration`, `ExpressionEvaluationOptions` for explicit configuration.
- Add `FloatingPointNumberType` and `IntegerNumberType` to configure parser number handling and string-to-number coercion in math helpers.
- Improve parser caching by including culture in the parser cache key.
- Refactor: Generate type-aware comparisons and optimize common numeric paths by [@​gumbarros](https://github.com/gumbarros) in [#​601](https://github.com/ncalc/ncalc/pull/601)
- Fix serialization of floating-point numbers by [@​gumbarros](https://github.com/gumbarros) in [#​605](https://github.com/ncalc/ncalc/pull/605)
#### Breaking Changes
- `ExpressionContext` now represents only per-evaluation runtime state. `StaticParameters` was renamed to `Parameters`, and `Options`, `CultureInfo`, `MathHelperOptions`, `ComparisonOptions`, and the implicit conversions from `ExpressionOptions`/`CultureInfo` were removed. Configure parsing and evaluation with `ExpressionConfiguration` instead.
- `ExpressionContext` is no longer a `record` and all props are init only to incentive immutability.
- `Expression.Options` no longer exposes the getter. It is kept only as a setter that replaces `Expression.Configuration` using `ExpressionConfiguration.FromOptions(...)`. Use `Expression.Configuration`, `Expression.ParserOptions`, `Expression.EvaluationOptions`, `Expression.CultureInfo`, and `Expression.Configuration.CacheEnabled`.
- `Expression` constructors and `IExpressionFactory.Create` now accept `ExpressionConfiguration` and `CultureInfo`.
- `Parameters`, `DynamicParameters`, `AsyncParameters`, `Functions`, and `AsyncFunctions` on `Expression` no longer have setters. Mutate the dictionaries on `Expression.Context` or replace them through a new `ExpressionContext`.
- `LogicalExpressionArgumentSeparator` was renamed to `ArgumentSeparator`.
- `LogicalExpressionParserOptions` no longer exposes `DecimalAsDefault` and `LongAsDefault`. Use `FloatingPointNumberType` and `IntegerNumberType`.
- `LogicalExpressionParser.GetOrCreateExpressionParser` now requires a `CultureInfo`, and `LogicalExpressionParser.Parse` accepts culture separately from parser options.
- `ILogicalExpressionFactory.Create` now accepts `LogicalExpressionParserOptions?` and `CultureInfo?` instead of `ExpressionOptions`.
- `IEvaluationVisitorFactory`, `EvaluationVisitor`, and `AsyncEvaluationVisitor` now require `ExpressionEvaluationOptions` and `CultureInfo`.
- `LogicalExpression` extension methods `Evaluate(...)` and `EvaluateAsync(...)` were removed. Evaluate through `Expression` or instantiate the appropriate evaluation visitor.
- `ComparisonOptions` was removed. Use `StringComparer` property.
- `MathHelperOptions` was renamed to `MathOptions`.
- `LogicalExpressionParserContext` was renamed to `LogicalExpressionParseContext` following Parlot convention
- The `NCalc.Antlr` package/plugin was removed. Use the default Parlot parser or provide a custom `ILogicalExpressionFactory`.
</details>
---
### Configuration
📅 **Schedule**: (UTC)
- Branch creation
- At any time (no schedule defined)
- Automerge
- At any time (no schedule defined)
🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC40LjUiLCJ1cGRhdGVkSW5WZXIiOiI0NC40LjUiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbXX0=-->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
This PR contains the following updates:
6.4.0→7.0.0Release Notes
ncalc/ncalc (NCalcSync)
v7.0.0ExpressionConfiguration,ExpressionEvaluationOptionsfor explicit configuration.FloatingPointNumberTypeandIntegerNumberTypeto configure parser number handling and string-to-number coercion in math helpers.Breaking Changes
ExpressionContextnow represents only per-evaluation runtime state.StaticParameterswas renamed toParameters, andOptions,CultureInfo,MathHelperOptions,ComparisonOptions, and the implicit conversions fromExpressionOptions/CultureInfowere removed. Configure parsing and evaluation withExpressionConfigurationinstead.ExpressionContextis no longer arecordand all props are init only to incentive immutability.Expression.Optionsno longer exposes the getter. It is kept only as a setter that replacesExpression.ConfigurationusingExpressionConfiguration.FromOptions(...). UseExpression.Configuration,Expression.ParserOptions,Expression.EvaluationOptions,Expression.CultureInfo, andExpression.Configuration.CacheEnabled.Expressionconstructors andIExpressionFactory.Createnow acceptExpressionConfigurationandCultureInfo.Parameters,DynamicParameters,AsyncParameters,Functions, andAsyncFunctionsonExpressionno longer have setters. Mutate the dictionaries onExpression.Contextor replace them through a newExpressionContext.LogicalExpressionArgumentSeparatorwas renamed toArgumentSeparator.LogicalExpressionParserOptionsno longer exposesDecimalAsDefaultandLongAsDefault. UseFloatingPointNumberTypeandIntegerNumberType.LogicalExpressionParser.GetOrCreateExpressionParsernow requires aCultureInfo, andLogicalExpressionParser.Parseaccepts culture separately from parser options.ILogicalExpressionFactory.Createnow acceptsLogicalExpressionParserOptions?andCultureInfo?instead ofExpressionOptions.IEvaluationVisitorFactory,EvaluationVisitor, andAsyncEvaluationVisitornow requireExpressionEvaluationOptionsandCultureInfo.LogicalExpressionextension methodsEvaluate(...)andEvaluateAsync(...)were removed. Evaluate throughExpressionor instantiate the appropriate evaluation visitor.ComparisonOptionswas removed. UseStringComparerproperty.MathHelperOptionswas renamed toMathOptions.LogicalExpressionParserContextwas renamed toLogicalExpressionParseContextfollowing Parlot conventionNCalc.Antlrpackage/plugin was removed. Use the default Parlot parser or provide a customILogicalExpressionFactory.Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate CLI.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.