- Issue 335 parsing of large decimal literals by @kierantop in ncalc#340
- Improve number parser readability by @gumbarros in ncalc#341
- Fix exponentiation at NCalc.Async by @gumbarros in ncalc#343
- Fix nested functions at
FunctionExtractionVisitor
by @gumbarros in ncalc#336 - Fix logical operator priority by @gumbarros in ncalc#338
- Fix
in
operator when there is an empty string by @gumbarros in ncalc#330
- Use
Microsoft.Extensions.Logging
instead of hard-coded logging by @gumbarros in ncalc#328 ExpressionOptions.NoStringTypeCoercion
should respectin
operator by @gumbarros in ncalc#329
- Allow objects to be used with the
in
operator by @gumbarros in ncalc#325 - Fix ternary operator at NCalcAsync by @gumbarros in ncalc#326
- Code Quality: Remove exponentiation duplicated logic by @gumbarros in ncalc#327
- Added
Like
operator by @gumbarros in ncalc#324
- Add
ExpressionOptions.NoStringTypeCoercion
by @alexwarren in ncalc#321 - Add
ExpressionOptions.AllowNullOrEmptyExpressions
by @gumbarros in ncalc#322
- Roslynator - PrivateAssets="all" by @Bykiev in ncalc#319
- Fix compiler warnings in NCalc.Tests by @axunonb in ncalc#318
- Fix number parsing by @Bykiev in ncalc#316
- Fix inner parameter and functions at extraction visitors by @gumbarros in ncalc#306
- Fix ExpressionOptions.IterateParameters by @Bykiev in ncalc#309
- Added
FunctionExtractionVisitor
by @gumbarros in ncalc#290 - Re-use
LogicalExpressionList
logic forFunction
parameters by @gumbarros in ncalc#291 - Added
EvaluationHelper
andin
operator should respect string comparer by @gumbarros in ncalc#292 - Small refactoring of MathHelper.ConvertToHighestPrecision by @Bykiev in ncalc#293
- Code cleanup by @Bykiev in ncalc#294
- Added
ExpressionBase
by @gumbarros in ncalc#297 - ifs improvement by @Bykiev in ncalc#298
- Update Parlot package by @Bykiev in ncalc#299
- Update Parlot (1.0.2) by @Bykiev in ncalc#300
- Add
ValueType.Guid
by @gumbarros in ncalc#301 - Breaking Change: Use
ValueTask
instead ofTask
atNCalc.Async
by @gumbarros in ncalc#302
Full Changelog: https://github.com/ncalc/ncalc/compare/v5.1.0...v5.2.0
- Fix typo in MathHelper by @Bykiev in ncalc#273
- Small refactoring of Expression.IterateParameters by @Bykiev in ncalc#274
- Added
ShouldHandleBinaryExpression
unit test by @gumbarros in ncalc#278 - Add new
ExpressionOptions.StringConcat
to concat values as string by @Bykiev in ncalc#276 - Added
ExpressionOptions.AllowCharValues
by @gumbarros in ncalc#279 - Remove appveyor and use GH Actions with Coverlet by @gumbarros in ncalc#284
- Small performance improvement for
BinaryExpression
by @gumbarros in ncalc#283 - Move benchmarks to a separate workflow by @gumbarros in ncalc#285
- Improve string_concatenation.md docs by @gumbarros in ncalc#281
- Move event handlers to
ExpressionContext
by @gumbarros in ncalc#286 - Add support for Parlot parser compilation via AppContext switch by @Bykiev in ncalc#288
- Update Parlot parser by @Bykiev in ncalc#289
- Added
LogicalExpressionList
andin
operator by @gumbarros in ncalc#287
- Overflow protection by @Bykiev in ncalc#256
- Consolidate NETStandard.Library package version by @Bykiev in ncalc#257
- Add OverflowProtection to
LambdaExpressionVisitor
by @gumbarros in ncalc#259 - Improve CI with
DOTNET_NOLOGO
andDOTNET_CLI_TELEMETRY_OPTOUT
by @gumbarros in ncalc#260 - Fix treating an expression with whitespace in fractional part as valid by @Bykiev in ncalc#262
- Added
IDictionary<string,ExpressionFunction>
andIDictionary<string,ExpressionParameter>
support by @gumbarros in ncalc#254 - Use decimal with exponentiation when DecimalAsDefault is used by @Bykiev in ncalc#269
- Add NOTRACE for the entire solution at Release by @gumbarros in ncalc#268
- Fix
AsyncFunctionArgs
regression by @gumbarros in ncalc#271 - Added
Id
property toIdentifier
by @gumbarros in ncalc#266 - Visitor pattern is now stateless with generics by @gumbarros in ncalc#272
NCalcAsync
now usesAsyncExpressionContext
ExpressionContext
is now arecord
instead of aclass
, allowing support for shallow cloningIEvaluationVisitor
is removed, please useIEvaluationService
for an easier to implement interfaceILogicalExpressionVisitor
is nowILogicalExpressionVisitor<T>
, where<T>
is the return of the visitorIAsyncLogicalExpressionVisitor
is removed, please useILogicalExpressionVisitor<Task<object?>>
AdvancedExpression
andAsyncAdvancedExpression
are removed, please use the respective constructors atExpression
andAsyncExpression
to prevent unnecessary casting.
- Add
MemberNotNullWhen
attribute toHasErrors
by @gmcchessney in ncalc#250 - Fix tests by @Bykiev in ncalc#251
- Fix parsing fractional zero by @Bykiev in ncalc#253
- Refactor MathHelper by @Bykiev in ncalc#255
- Fix handling new lines in expression by @Bykiev in ncalc#234
- Add support UInt64 for binary operators by @Bykiev in ncalc#237
- Fix parsing expression by @Bykiev in ncalc#241
- Re-added
HasErrors
method toNCalc.Async
by @gumbarros in ncalc#245 - Require braces to be closed by a brace of the same type by @gumbarros in ncalc#246
- Make unclosed brace cause a parsing exception by @gmcchessney in ncalc#243
- Fix handling new lines in expression by @Bykiev in ncalc#234
- Added
async
support by @gumbarros in ncalc#207 - Remove unused Parlot rule by @Bykiev in ncalc#221
- Inline
TypeHelper.IsReal
by @gumbarros in ncalc#225 - Allow whitespace at end of expression by @gumbarros and @Bykiev in ncalc#224
- Re-added Benchmark project by @gumbarros in ncalc#220
- Run Benchmark at CI by @gumbarros in ncalc#228
- Fixed not operator behavior by @gumbarros and @Bykiev in ncalc#227
Expression
is nowAsyncExpression
atNCalcAsync
, related classes are also prefixed with Async to prevent naming collisions- Removed obsolete
HasOption
extension method fromExpressionOptions
, please useHasFlag
- Removed obsolete
CaseInsensitiveComparer
enum member, please useCaseInsensitiveStringComparer
- 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
- 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
- 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
- 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
- Parlot is used instead of Antlr for parsing by Andrey Bykiev, Gustavo Mauricio de Barros and Sébastien Ros
GetParametersNames
no 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
- .NET Framework 4.6.1 no longer supported, please update to .NET Framework 4.6.2 or higher
- Renamed
EvaluateOptions
enum toExpressionOptions
- Renamed
EvaluateOptionsExtensions
class toExpressionOptionsExtensions
- Renamed
Expression.OriginalExpression
property toExpression.ExpressionString
- Renamed
Expression.ParsedExpression
property toExpression.LogicalExpression
- Renamed
Numbers
static class toMathHelper
- Removed
Expression.Compile
static method, please useLogicalExpressionFactory.Create
- Removed unused
BinaryExpressionType.Unknown
enum value Expression.Error
property now stores anException
object instead of astring
Expression.GetParametersNames
method now returns aList<String>
instead of astring[]
- CompareUsingMostPreciseType is now public again by Gustavo Mauricio de Barros
- Fixed
BitwiseXOr
behavior by Gustavo Mauricio de Barros
- 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
- 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
- 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
- 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
- .NET 8 + C#12 + ReSharper refactors by Gustavo Mauricio de Barros
- Added EvaluateOptions.CaseInsensitiveComparer by Gustavo Mauricio de Barros
- CompareUsingMostPreciseType chooses first option, not best by @ThomasHambach
- EvaluationVisitor.Result should be protected, not private by Oleksandr Kovaliv
- 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
- Add arithmetic support for multiple operators and types by Justin Baugh
- Using OrdinalIgnoreCase instead of ToLower() checks by Andrey Bykiev
Several syntax changes to the grammar:
- Exponentiation operator
**
- Case insensitive operators and key words (e.g.
AND
orTrue
) - 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 anEvaluationException
is 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()
Initial public release of the .NET Core version.