Skip to content

Releases: scicave/math-parser

🌟 11 Jan 2021, v4.0

11 Jan 08:55
12f85a6
Compare
Choose a tag to compare

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 if extra.ellipsis is true
    • (..., a): is a tuple, parsed if extra.ellipsis is true
    • [2, 1, ]: is a matrix, parsed if extra.trailingComma is true
    • (1, 2,): is a tuple, parsed if extra.trailingComma is true
    • [, a]: is a matrix, parsed if extra.blankTerms is true
    • (, a): is a tuple, parsed if extra.blankTerms is true
  • 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, if options.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

01 Jan 19:23
363aa8c
Compare
Choose a tag to compare
Pre-release

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 be Array 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 with type = "tuple".

Added

  • Built-in function sqrt
  • Node of type "tuple": (1, 2, x, ...)

Update to version v2.2.1

31 Aug 21:15
Compare
Choose a tag to compare

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 of options.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!)".