- Increased upper SDK constraint to declare support for Dart 3
- Documentation fixes
- Now the
'
symbol is allowed for variable and function names so you can have variables likey'
.
- Implemented
>=
and<=
.
- Define custom functions and redefine built-in functions when parsing an expression. See docs and example.
- Use
MathNodeExpression.getPotentialFunctionNames()
to detect potentially used functions in a string. - Use period in the middle of custom variable and function names.
- Under-hood, functions now support multiple comma separated arguments, so you can supply multiple arguments to your custom function.
- Detect custom functions im math tree using
MathExpression.getUsedFreeformFunctions()
.
MissingFunctionArgumentListException
renamed toOutOfRangeFunctionArgumentListException
MathNodeExpression.fromString()
may throw other errors besidesMathException
MathNodeExpression.getPotentialVariableNames()
is replaced byMathNodeExpression.getPotentialDefinable()
- Instead of
log[base](arg)
, you should passlog(base, arg)
syntax now - Period is an allowed character in the middle of a variable name now
UnexpectedClosingBracketException
andBracketsNotClosedException
can now tell where the problem probably happened.- New MathParseException's
InvalidFunctionNameException
,DuplicateDeclarationException
,InvalidFunctionArgumentsDeclaration
.
- Variable validation fix
- Important change:
MathNode
is now a class ofMathExpression
interface. Compared to MathNode, MathExpression may return null incalc()
method. - New:
getUsedVariables()
method forMathExpression
andMathNode
. This method goes down the math tree to find any uses ofMathVariable
and returns names of all variables. - New:
MathExpression
object family -MathComparison
:MathComparisonEquation
(=)MathComparisonGreater
(>)MathComparisonLess
(<)
- New:
MathNodeExpression.fromStringExtended()
method allows you to interpret equations and comparisons. Compared tofromString
, it returnsMathExpression
instead ofMathNode
, since comparisons can't guarantee result. - New:
MathNodeExpression.getPotentialVariableNames()
analyzes given math expression string for possible use of variables. Refer to documentation for rough edges before using it. - New:
MathNodeExpression.builtInVariables
gives a list of built-in predefined variable names. - New:
MathNodeExpression.isVariableNameValid()
lets you check if the parser can work with a given name.
- Changed input parameters type for
CantProcessExpressionException
. - Small documentation fixes.
- Fix README.
- Moved integrating features to a separate package library
math_parser_integrate
.
- Custom variables support.
MathFunctionX
deprecated.MathVariable
introduced.- You need to pass an instance of
MathVariableValues
instead of a num to thecalc()
function now.
- Initial version.