function parse(expr, options) {
    if (arguments.length !== 1 && arguments.length !== 2) {
      throw new ArgumentsError('parse', arguments.length, 1, 2);
    } // pass extra nodes


    var extraNodes = options && options.nodes ? options.nodes : {};

    if (typeof expr === 'string') {
      // parse a single expression
      return parseStart(expr, extraNodes);
    } else if (Array.isArray(expr) || expr instanceof type.Matrix) {
      // parse an array or matrix with expressions
      return deepMap(expr, function (elem) {
        if (typeof elem !== 'string') throw new TypeError('String expected');
        return parseStart(elem, extraNodes);
      });
    } else {
      // oops
      throw new TypeError('String or matrix expected');
    }
  } // token types enumeration
Parse an expression. Returns a node tree, which can be evaluated by
invoking node.eval().

Syntax:

    parse(expr)
    parse(expr, options)
    parse([expr1, expr2, expr3, ...])
    parse([expr1, expr2, expr3, ...], options)

Example:

    const node = parse('sqrt(3^2 + 4^2)')
    node.compile(math).eval() // 5

    let scope = {a:3, b:4}
    const node = parse('a * b') // 12
    const code = node.compile(math)
    code.eval(scope) // 12
    scope.a = 5
    code.eval(scope) // 20

    const nodes = math.parse(['a = 3', 'b = 4', 'a * b'])
    nodes[2].compile(math).eval() // 12

@param {string | string[] | Matrix} expr
@param {{nodes: Object<string, Node>}} [options]  Available options:
                                                  - `nodes` a set of custom nodes
@return {Node | Node[]} node
@throws {Error}