function handleToken(tokens, name) {
    const value = tokens[name]

    const type = Prism.util.type(value)
    switch (type) {
      case `RegExp`: {
        const inside = {}
        tokens[name] = {
          pattern: value,
          inside: inside,
        }
        addInvisibles(inside)
        break
      }
      case `Array`: {
        for (let i = 0, l = value.length; i < l; i++) {
          handleToken(value, i)
        }
        break
      }

      default: {
        // 'Object'
        const inside = value.inside || (value.inside = {}) // eslint-disable-line no-redeclare
        addInvisibles(inside)
        break
      }
    }
  }
Handles the recursive calling of `addInvisibles` for one token.

@param {Object|Array} tokens The grammar or array which contains the token.
@param {string|number} name The name or index of the token in `tokens`.