5.6.0
- Improve SerializationVisitor perf by @Bykiev in https://github.com/ncalc/ncalc/pull/451
- Update packages by @Bykiev in https://github.com/ncalc/ncalc/pull/452
- Move IsReal check in MathHelper by @Bykiev in https://github.com/ncalc/ncalc/pull/453
- Refactor Like/NotLike functions by @Bykiev in https://github.com/ncalc/ncalc/pull/454
Breaking Changes
- Move lambda compilation to
NCalc.LambdaCompilationby @gumbarros in https://github.com/ncalc/ncalc/pull/456
5.5.0
- Change parser by @Bykiev in https://github.com/ncalc/ncalc/pull/416
- Fix handling culture separator for datetimes by @Bykiev in https://github.com/ncalc/ncalc/pull/424
- Improve lambda compilation performance by @Bykiev in https://github.com/ncalc/ncalc/pull/407
- Update BenchmarkDotNet by @Bykiev in https://github.com/ncalc/ncalc/pull/425
- Small code improvements by @Bykiev in https://github.com/ncalc/ncalc/pull/422
- Fix tests results output on CI by @Bykiev in https://github.com/ncalc/ncalc/pull/432
- Update Parlot by @Bykiev in https://github.com/ncalc/ncalc/pull/436
- Update packages by @Bykiev in https://github.com/ncalc/ncalc/pull/419
Breaking Changes
- The number with fractional part with scientific notation without specifying fractional part is not valid anymore (123.E2 is not a valid expression anymore, should be 123.0E2)
5.4.1
- Update Parlot version by @gumbarros in https://github.com/ncalc/ncalc/pull/397`
5.4.0
- Update NCalc.Core.csproj by @sebastienros in https://github.com/ncalc/ncalc/pull/381
- Update GH actions to latest by @sebastienros in https://github.com/ncalc/ncalc/pull/382
- Add binary, octal and hexadecimal number support. by @slobber in https://github.com/ncalc/ncalc/pull/388
- Update parameters.md by @gmkado in https://github.com/ncalc/ncalc/pull/385
- Documentation - Broken Links & Formatting by @Jason-Barratt in https://github.com/ncalc/ncalc/pull/389
- Use CultureInfo in string concatenation by @ridago in https://github.com/ncalc/ncalc/pull/392
- Fix culture info test by @ridago in https://github.com/ncalc/ncalc/pull/393
- Added
IEvaluationVisitorFactoryfor more granular control over evaluation. by @gumbarros in https://github.com/ncalc/ncalc/pull/395 - Update 3rd party dependencies by @gumbarros in https://github.com/ncalc/ncalc/pull/396
Breaking Changes
- Removed
IEvaluationService, please useIEvaluationVisitorFactory. Check this article for more info.
5.3.1
- Small code quality improvements by @gumbarros in https://github.com/ncalc/ncalc/pull/365
- Fix Directory.Build.props inheritance by @sebastienros in https://github.com/ncalc/ncalc/pull/373
- Update packages by @Bykiev in https://github.com/ncalc/ncalc/pull/366
- Small code quality improvements by @gumbarros in https://github.com/ncalc/ncalc/pull/376
- Added issue #372 unit test by @gumbarros in https://github.com/ncalc/ncalc/pull/377
5.3.0
- Improve SerializationVisitor performance by @Bykiev in https://github.com/ncalc/ncalc/pull/353
- Remove nullable disable by @Bykiev in https://github.com/ncalc/ncalc/pull/355
- Improve performance of math functions by @Bykiev in https://github.com/ncalc/ncalc/pull/356
- Lambdas - use BigDecimal in Pow function by @Bykiev in https://github.com/ncalc/ncalc/pull/357
- Round - use int32 as digits parameter type by @Bykiev in https://github.com/ncalc/ncalc/pull/359
- Lambdas - add support for DecimalAsDefault by @Bykiev in https://github.com/ncalc/ncalc/pull/358
- Update to .NET 9, C# 13 and update all external dependencies to latest version. by @gumbarros in https://github.com/ncalc/ncalc/pull/361
- Update NCalc logo by @gumbarros in https://github.com/ncalc/ncalc/pull/363
- Added JSON polymorphism support by @gumbarros in https://github.com/ncalc/ncalc/pull/364
Breaking Changes
- Remove obsolete
Expressionsproperty fromFunctionclass by @gumbarros in https://github.com/ncalc/ncalc/pull/362
5.2.11
- Update packages by @Bykiev in https://github.com/ncalc/ncalc/pull/346
- Fix culture support with NoStringTypeCoercion by @Bykiev in https://github.com/ncalc/ncalc/pull/347
- Added
ExpressionOptions.StrictTypeMatchingby @gumbarros in https://github.com/ncalc/ncalc/pull/351
5.2.10
- Issue 335 parsing of large decimal literals by @kierantop in https://github.com/ncalc/ncalc/pull/340
- Improve number parser readability by @gumbarros in https://github.com/ncalc/ncalc/pull/341
- Fix exponentiation at NCalc.Async by @gumbarros in https://github.com/ncalc/ncalc/pull/343
5.2.9
- Fix nested functions at
FunctionExtractionVisitorby @gumbarros in https://github.com/ncalc/ncalc/pull/336 - Fix logical operator priority by @gumbarros in https://github.com/ncalc/ncalc/pull/338
5.2.8
- Fix
inoperator when there is an empty string by @gumbarros in https://github.com/ncalc/ncalc/pull/330
5.2.7
- Use
Microsoft.Extensions.Logginginstead of hard-coded logging by @gumbarros in https://github.com/ncalc/ncalc/pull/328 ExpressionOptions.NoStringTypeCoercionshould respectinoperator by @gumbarros in https://github.com/ncalc/ncalc/pull/329
5.2.6
- Allow objects to be used with the
inoperator by @gumbarros in https://github.com/ncalc/ncalc/pull/325 - Fix ternary operator at NCalcAsync by @gumbarros in https://github.com/ncalc/ncalc/pull/326
- Code Quality: Remove exponentiation duplicated logic by @gumbarros in https://github.com/ncalc/ncalc/pull/327
5.2.5
- Added
Likeoperator by @gumbarros in https://github.com/ncalc/ncalc/pull/324
5.2.4
- Add
ExpressionOptions.NoStringTypeCoercionby @alexwarren in https://github.com/ncalc/ncalc/pull/321 - Add
ExpressionOptions.AllowNullOrEmptyExpressionsby @gumbarros in https://github.com/ncalc/ncalc/pull/322
5.2.3
- Roslynator - PrivateAssets="all" by @Bykiev in https://github.com/ncalc/ncalc/pull/319
- Fix compiler warnings in NCalc.Tests by @axunonb in https://github.com/ncalc/ncalc/pull/318
5.2.2
- Fix number parsing by @Bykiev in https://github.com/ncalc/ncalc/pull/316
5.2.1
- Fix inner parameter and functions at extraction visitors by @gumbarros in https://github.com/ncalc/ncalc/pull/306
- Fix ExpressionOptions.IterateParameters by @Bykiev in https://github.com/ncalc/ncalc/pull/309
5.2.0
- Added
FunctionExtractionVisitorby @gumbarros in https://github.com/ncalc/ncalc/pull/290 - Re-use
LogicalExpressionListlogic forFunctionparameters by @gumbarros in https://github.com/ncalc/ncalc/pull/291 - Added
EvaluationHelperandinoperator should respect string comparer by @gumbarros in https://github.com/ncalc/ncalc/pull/292 - Small refactoring of MathHelper.ConvertToHighestPrecision by @Bykiev in https://github.com/ncalc/ncalc/pull/293
- Code cleanup by @Bykiev in https://github.com/ncalc/ncalc/pull/294
- Added
ExpressionBaseby @gumbarros in https://github.com/ncalc/ncalc/pull/297 - ifs improvement by @Bykiev in https://github.com/ncalc/ncalc/pull/298
- Update Parlot package by @Bykiev in https://github.com/ncalc/ncalc/pull/299
- Update Parlot (1.0.2) by @Bykiev in https://github.com/ncalc/ncalc/pull/300
- Add
ValueType.Guidby @gumbarros in https://github.com/ncalc/ncalc/pull/301 - Breaking Change: Use
ValueTaskinstead ofTaskatNCalc.Asyncby @gumbarros in https://github.com/ncalc/ncalc/pull/302
5.1.0
- Fix typo in MathHelper by @Bykiev in https://github.com/ncalc/ncalc/pull/273
- Small refactoring of Expression.IterateParameters by @Bykiev in https://github.com/ncalc/ncalc/pull/274
- Added
ShouldHandleBinaryExpressionunit test by @gumbarros in https://github.com/ncalc/ncalc/pull/278 - Add new
ExpressionOptions.StringConcatto concat values as string by @Bykiev in https://github.com/ncalc/ncalc/pull/276 - Added
ExpressionOptions.AllowCharValuesby @gumbarros in https://github.com/ncalc/ncalc/pull/279 - Remove appveyor and use GH Actions with Coverlet by @gumbarros in https://github.com/ncalc/ncalc/pull/284
- Small performance improvement for
BinaryExpressionby @gumbarros in https://github.com/ncalc/ncalc/pull/283 - Move benchmarks to a separate workflow by @gumbarros in https://github.com/ncalc/ncalc/pull/285
- Improve string_concatenation.md docs by @gumbarros in https://github.com/ncalc/ncalc/pull/281
- Move event handlers to
ExpressionContextby @gumbarros in https://github.com/ncalc/ncalc/pull/286 - Add support for Parlot parser compilation via AppContext switch by @Bykiev in https://github.com/ncalc/ncalc/pull/288
- Update Parlot parser by @Bykiev in https://github.com/ncalc/ncalc/pull/289
- Added
LogicalExpressionListandinoperator by @gumbarros in https://github.com/ncalc/ncalc/pull/287
5.0.0
- Overflow protection by @Bykiev in https://github.com/ncalc/ncalc/pull/256
- Consolidate NETStandard.Library package version by @Bykiev in https://github.com/ncalc/ncalc/pull/257
- Add OverflowProtection to
LambdaExpressionVisitorby @gumbarros in https://github.com/ncalc/ncalc/pull/259 - Improve CI with
DOTNET_NOLOGOandDOTNET_CLI_TELEMETRY_OPTOUTby @gumbarros in https://github.com/ncalc/ncalc/pull/260 - Fix treating an expression with whitespace in fractional part as valid by @Bykiev in https://github.com/ncalc/ncalc/pull/262
- Added
IDictionary<string,ExpressionFunction>andIDictionary<string,ExpressionParameter>support by @gumbarros in https://github.com/ncalc/ncalc/pull/254 - Use decimal with exponentiation when DecimalAsDefault is used by @Bykiev in https://github.com/ncalc/ncalc/pull/269
- Add NOTRACE for the entire solution at Release by @gumbarros in https://github.com/ncalc/ncalc/pull/268
- Fix
AsyncFunctionArgsregression by @gumbarros in https://github.com/ncalc/ncalc/pull/271 - Added
Idproperty toIdentifierby @gumbarros in https://github.com/ncalc/ncalc/pull/266 - Visitor pattern is now stateless with generics by @gumbarros in https://github.com/ncalc/ncalc/pull/272
Breaking Changes
NCalcAsyncnow usesAsyncExpressionContextExpressionContextis now arecordinstead of aclass, allowing support for shallow cloningIEvaluationVisitoris removed, please useIEvaluationServicefor an easier to implement interfaceILogicalExpressionVisitoris nowILogicalExpressionVisitor<T>, where<T>is the return of the visitorIAsyncLogicalExpressionVisitoris removed, please useILogicalExpressionVisitor<Task<object?>>AdvancedExpressionandAsyncAdvancedExpressionare removed, please use the respective constructors atExpressionandAsyncExpressionto prevent unnecessary casting.
4.3.3
- Add
MemberNotNullWhenattribute toHasErrorsby @gmcchessney in https://github.com/ncalc/ncalc/pull/250 - Fix tests by @Bykiev in https://github.com/ncalc/ncalc/pull/251
- Fix parsing fractional zero by @Bykiev in https://github.com/ncalc/ncalc/pull/253
- Refactor MathHelper by @Bykiev in https://github.com/ncalc/ncalc/pull/255
4.3.2
- Fix handling new lines in expression by @Bykiev in https://github.com/ncalc/ncalc/pull/234
- Add support UInt64 for binary operators by @Bykiev in https://github.com/ncalc/ncalc/pull/237
- Fix parsing expression by @Bykiev in https://github.com/ncalc/ncalc/pull/241
- Re-added
HasErrorsmethod toNCalc.Asyncby @gumbarros in https://github.com/ncalc/ncalc/pull/245 - Require braces to be closed by a brace of the same type by @gumbarros in https://github.com/ncalc/ncalc/pull/246
- Make unclosed brace cause a parsing exception by @gmcchessney in https://github.com/ncalc/ncalc/pull/243
4.3.1
- Fix handling new lines in expression by @Bykiev in https://github.com/ncalc/ncalc/pull/234
4.3.0
- Added
asyncsupport by @gumbarros in https://github.com/ncalc/ncalc/pull/207 - Remove unused Parlot rule by @Bykiev in https://github.com/ncalc/ncalc/pull/221
- Inline
TypeHelper.IsRealby @gumbarros in https://github.com/ncalc/ncalc/pull/225 - Allow whitespace at end of expression by @gumbarros and @Bykiev in https://github.com/ncalc/ncalc/pull/224
- Re-added Benchmark project by @gumbarros in https://github.com/ncalc/ncalc/pull/220
- Run Benchmark at CI by @gumbarros in https://github.com/ncalc/ncalc/pull/228
- Fixed not operator behavior by @gumbarros and @Bykiev in https://github.com/ncalc/ncalc/pull/227
Breaking Changes
Expressionis nowAsyncExpressionatNCalcAsync, related classes are also prefixed with Async to prevent naming collisions- Removed obsolete
HasOptionextension method fromExpressionOptions, please useHasFlag - Removed obsolete
CaseInsensitiveComparerenum member, please useCaseInsensitiveStringComparer
4.2.1
- Fix treating NOT as unary in function name by Andrey Bykiev
- Fix GetParametersNames() method inifinte loop with unary operators by Andrey Bykiev
- Fix parsing floating-point numbers by Andrey Bykiev
- Fix handling invalid expression with comma by Sébastien Ros, Andrey Bykiev
4.2
- Improve Parlot error handling by Andrey Bykiev
- Fix OverflowException with double values by Andrey Bykiev, Gustavo Mauricio de Barros
- Fix double value precision loss by Andrey Bykiev, Gustavo Mauricio de Barros
- Add new ExpressionOptions.AllowBooleanCalculation and ExpressionOptions.OrdinalStringComparer options. ExpressionOptions.CaseInsensitiveComparer is now obsolete, please use ExpressionOptions.CaseInsensitiveStringComparer instead by Gustavo Mauricio de Barros
- Add support for compilation of expressions to CLR lambdas by Gustavo Mauricio de Barros. Credits to Sebastian Klose and NCalc2 project contributors
- HasOption method from ExpressionOptions is now obsolete, please use HasFlag by Gustavo Barros
- AOT apps now work again with NCalc by Gustavo Barros
Breaking Changes
- Do not convert external function name to lower case when ExpressionOptions.IgnoreCase option is used by Andrey Bykiev
- Add support for using null with operators by Andrey Bykiev
- Exceptions need to be handled as NCalcEvaluationException instead of ArgumentException and added TypeHelper by Gustavo Barros
- Use IOptions instead of IOptionsSnapshot at LogicalExpressionMemoryCache by Gustavo Barros
- Changed the logic of ExpressionOptions.DecimalAsDefault. When this option is specified, all function parameters are expected to be decimal by Gustavo Barros
- Fully removed LogicalExpressionVisitor, please use ILogicalExpressionVisitor by Gustavo Barros
4.1
- Remove excessive check for casing by Andrey Bykiev
- Add support for comparison with null parameters by Andrey Bykiev
- Fix support for TimeSpan and DateTime with hours, minutes and seconds by Gustavo Barros
- Add Dependency Injection support with IMemoryCache plugin by Gustavo Barros
- Add support for using semicolon as argument separator by Andrey Bykiev
- Fix invalid token handling by Andrey Bykiev
- Add support fo curly braces as alternative to square brackets by Andrey Bykiev
- Re-added ANTLR as a plugin by Gustavo Barros
4.0
- Parlot is used instead of Antlr for parsing by Andrey Bykiev, Gustavo Mauricio de Barros and Sébastien Ros
GetParametersNamesno longer adds same parameter more than one time to the result by Gustavo Mauricio de Barros- xUnit is now used for unit tests by Gustavo Mauricio de Barros
- New DocFX website with articles and public API by Gustavo Mauricio de Barros
Breaking Changes
- .NET Framework 4.6.1 no longer supported, please update to .NET Framework 4.6.2 or higher
- Renamed
EvaluateOptionsenum toExpressionOptions - Renamed
EvaluateOptionsExtensionsclass toExpressionOptionsExtensions - Renamed
Expression.OriginalExpressionproperty toExpression.ExpressionString - Renamed
Expression.ParsedExpressionproperty toExpression.LogicalExpression - Renamed
Numbersstatic class toMathHelper - Removed
Expression.Compilestatic method, please useLogicalExpressionFactory.Create - Removed unused
BinaryExpressionType.Unknownenum value Expression.Errorproperty now stores anExceptionobject instead of astringExpression.GetParametersNamesmethod now returns aList<String>instead of astring[]
3.13.1
- CompareUsingMostPreciseType is now public again by Gustavo Mauricio de Barros
- Fixed
BitwiseXOrbehavior by Gustavo Mauricio de Barros
3.13
- Performance: Use pattern matching instead of TypeCode by Gustavo Mauricio de Barros
- Fix boolean comparison by Gustavo Mauricio de Barros
- Test for inner exception type instead of exception message by axunonb
- Update project to create unsigned and signed versions of NCalcSync by axunonb
3.12
- Allow using decimal as default floating point type by Luca Schimweg
- Use correct CLR types at GetMostPreciseType by Gustavo Mauricio de Barros
- Performance improvements: Optimize built-in functions name checking and use ConcurrentDictionary<string, WeakReference
> at caching by Gustavo Mauricio de Barros - Options were not propagating to EvaluationVisitor by Gustavo Mauricio de Barros
3.11
- Evaluate function and parameters only once by Gustavo Mauricio de Barros
- Performance improvements: CA1860 and CA1834 by Gustavo Mauricio de Barros
- Add GetParametersNames method to Expression.cs by Gustavo Mauricio de Barros, Added Expression.GetParameters() method by Rodion Mostovoi
3.10
- Make EvaluationVisitor sub-class friendly by Nick
- Add support for ifs(cond, val, default) by Justin Baugh
- Added EvaluationVisitor at ctor by Gustavo Mauricio de Barros
- Updated ANTLR runtime to v4.13.1
3.9
- .NET 8 + C#12 + ReSharper refactors by Gustavo Mauricio de Barros
- Added EvaluateOptions.CaseInsensitiveComparer by Gustavo Mauricio de Barros
3.8
- CompareUsingMostPreciseType chooses first option, not best by @ThomasHambach
- EvaluationVisitor.Result should be protected, not private by Oleksandr Kovaliv
3.7
- Add parameterless constructor to ValueExpression by @ThomasHambach
- Add Min and Max to unit tests by by @ThomasHambach
- Update from Antlr3.Runtime to Antlr4.Runtime.Standard 4.12.0 by @markcanary
3.6
- Add arithmetic support for multiple operators and types by Justin Baugh
- Using OrdinalIgnoreCase instead of ToLower() checks by Andrey Bykiev
3.5
3.4
3.2
3.1
3.0
Several syntax changes to the grammar:
- Exponentiation operator
** - Case insensitive operators and key words (e.g.
ANDorTrue) - Support numbers with trailing dot (e.g.
47.) - Support for positive sign (e.g.
+5)
While these changes in themselves wouldn't introduce compatibility issues with previously valid statements, code that relies on statements with these constructs being invalid would be affected. The grammar also had to be regenerated with a new version of ANTLR with some fixes to it since it was clear that the generated source code had been modified manually. Manual review indicates that the regenerated grammar is identical, but because of both these reasons this is released as a new major version.
- Bugfix: invalid tokens were skipped silently without any errors. Expressions like
"4711"would ignore the"(since that is not the string character in the NCalc syntax) and parse it as the number4711, but now anEvaluationExceptionis thrown as for other syntax issues. This may affect existing expressions, but since they were always incorrect and now give an exception rather than silently getting a new value it does not merit a new major release. - Major bugfix: long integers are now treated as integers. Previous versions converted them to single-precision floats, which caused data loss on large numbers. Since this affects the results of existing expressions, it requires a new major release.
- New builtin function
Ln()
2.0
Initial public release of the .NET Core version.