- Update ANTLR to v4 to remove transient targeting of NETStandard 1.6.0, which caused problems when publishing solutions on a modern .NET (Thanks @markcanary!)
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.
- Handle += for
Expression.EvaluateFunctionAsync
andExpression.EvaluateParameterAsync
- Parameter names are changed to lowercase if
EvaluateOptions.IgnoreCase
is set (previously only function names were lowercased)
Initial public release.