function calculateNecessaryParentheses (node, parenthesis, implicit) {
    const precedence = getPrecedence(node, parenthesis, implicit)
    const parens = {}

    const startPrecedence = getPrecedence(node.start, parenthesis, implicit)
    parens.start = ((startPrecedence !== null) && (startPrecedence <= precedence)) ||
      (parenthesis === 'all')

    if (node.step) {
      const stepPrecedence = getPrecedence(node.step, parenthesis, implicit)
      parens.step = ((stepPrecedence !== null) && (stepPrecedence <= precedence)) ||
        (parenthesis === 'all')
    }

    const endPrecedence = getPrecedence(node.end, parenthesis, implicit)
    parens.end = ((endPrecedence !== null) && (endPrecedence <= precedence)) ||
      (parenthesis === 'all')

    return parens
  }
Calculate the necessary parentheses
@param {Node} node
@param {string} parenthesis
@param {string} implicit
@return {Object} parentheses
@private