src/abstract-syntax-tree.js
function createOperatorNode(operand, nodes = []) {
  return (scope, opts) => {
    const args = nodes.map(node => node(scope, opts));

    if (typeof operand === 'function') {
      return operand(...args);
    }

    const operator = get(opts.functions, operand);

    if (!operator) {
      throw new ReferenceError(`Function '${operand}' isn't declared`);
    }

    return operator(...args);
  };
}
function createOperatorNode(operand, nodes = []) {
  return (scope, opts) => {
    const args = nodes.map(node => node(scope, opts));

    if (typeof operand === 'function') {
      return operand(...args);
    }

    const operator = get(opts.functions, operand);

    if (!operator) {
      throw new ReferenceError(`Function '${operand}' isn't declared`);
    }

    return operator(...args);
  };
}
function createOperatorNode ( operand , nodes = [ ] ) { return ( scope , opts ) => { const args = nodes . map ( node => node ( scope , opts ) ) ; if ( typeof operand === 'function' ) { return operand ( ... args ) ; } const operator = get ( opts . functions , operand ) ; if ( ! operator ) { throw new ReferenceError ( ` ${ operand } ` ) ; } return operator ( ... args ) ; } ; }
Create operator tree node
@return {Function} compiled node
@private
Create operator tree node