code: function endOfMode(mode, lexeme) {
      if (test(mode.endRe, lexeme)) {
        while (mode.endsParent && mode.parent) {
          mode = mode.parent
        }
  
        return mode
      }
  
      if (mode.endsWithParent) {
        return endOfMode(mode.parent, lexeme)
      }
    }
docs: Check if `lexeme` ends `mode`.