Releases: scicave/math-parser
Releases · scicave/math-parser
🌟 11 Jan 2021, v4.0
Breaking
- Update section
Unsure About
in README.md, change the way this ambiguous expression parsed. extra.ellipsis
now accept a boolean value, true, false.- These expression are valid if allowed in
options.extra.{ellipsis, blankTerms}
:(..., a)
(, a)
(a, )
is tuple depending on extra options.
- Intervals, should have 2 terms as math expression:
(..., a]
: throw syntax error, parsed ifextra.ellipsis
istrue
(..., a)
: is a tuple, parsed ifextra.ellipsis
istrue
[2, 1, ]
: is a matrix, parsed ifextra.trailingComma
istrue
(1, 2,)
: is a tuple, parsed ifextra.trailingComma
istrue
[, a]
: is a matrix, parsed ifextra.blankTerms
istrue
(, a)
: is a tuple, parsed ifextra.blankTerms
istrue
- Remove option
strict
.
Add
options.keepParen
: if you want to parse parenthesis as nodes in the AST,{ type: "parenthesis" }
.options.extra.matrices
options.builtInIDs
infinity, pi, phi
: these have specific values or notions in maths.phix
is considered as automult of single-char ids, ifoptions.singleCharName=true
, otherwise it is node of type "id" with name "phix".- when strict the previous expression will be automult of single-char ids, equivalent to
p*h*i*x
.
1 Jan 2021, v3.0.0-alpha.0
Breaking
- Node of type "function", when its args is
[{ type: "block", name: "()", ... }]
, function's args is assigned to parenthesis args. In other words, in this case it will beArray
not{ type: "block", ... }
. - Removing node type
delimeter
:f(1,3,4)
when parsed as function, it will have args with length 3.(1,3,4)
will be parsed withtype = "tuple"
.
Added
- Built-in function
sqrt
- Node of type "tuple":
(1, 2, x, ...)
Update to version v2.2.1
31 Aug 2020, v2.2.1
Summary of changes:
- Add version property to the exported package, which is now "2.2.1"
- Add strict to options, see README.md
- Parse "member expression" such as "p.first_component" and "f(x).someThing.another()" wether or not
options.singleCharName == true
. - When
options.strict == false
, "f()" is function regardless ofoptions.functions
. - When
options.strict == false
, "f + a - sin" is parse with no "Function used as variable" error. - Allow functions to be invoked by void parentheses such as "f()";
- A more intelligent way to handle
- Fix operators ^ and ! from the previous release to parse some expression like: "5^2x!" as "(5^2)(x!)".