docs: public static boolean isRegexPreceder(String jsTokens) {
      // Tokens that precede a regular expression in JavaScript.
      // "!", "!=", "!==", "#", "%", "%=", "&", "&&", "&&=", "&=", "(", "*", "*=", "+", "+=", ",",
      // "-", "-=", "->", ".", "..", "...", "/", "/=", ":", "::", ";", "<", "<<", "<<=", "<=", "=",
      // "==", "===", ">", ">=", ">>", ">>=", ">>>", ">>>=", "?", "@", "[", "^", "^=", "^^", "^^=",
      // "{", "|", "|=", "||", "||=", "~",
      // "break", "case", "continue", "delete", "do", "else", "finally", "instanceof", "return",
      // "throw", "try", "typeof"
  
      int jsTokensLen = jsTokens.length();
      char lastChar = jsTokens.charAt(jsTokensLen - 1);
      switch (lastChar) {
        case '=':
        case '#':
        case '%':
        case '&':
        case '(':
        case '*':
        case ',':
        case '<':
        case '>':
        case '?':
        case ':':
        case ';':
        case '^':
        case '{':
        case '|':
        case '}':
        case '~':
        case '[':
          return true;
        case '+':
        case '-':
          // ++ and -- are not
          int signStart = jsTokensLen - 1;
          // Count the number of adjacent dashes or pluses.
          while (signStart > 0 && jsTokens.charAt(signStart - 1) == lastChar) {
            --signStart;
          }
          int numAdjacent = jsTokensLen - signStart;
          // True for odd numbers since "---" is the same as "-- -".
          // False for even numbers since "----" is the same as "-- --" which ends with a decrement,
          // not a minus sign.
          return (numAdjacent & 1) == 1;
        case '.':
          if (jsTokensLen == 1) {
            return true;
          }
          // There is likely to be a .. or ... operator in newer versions of EcmaScript.
          char ch = jsTokens.charAt(jsTokensLen - 2);
          return !('0' <= ch && ch <= '9');
        default:
          // Look for one of the keywords above.
          int wordStart = jsTokensLen;
          while (wordStart > 0 && Character.isJavaIdentifierPart(jsTokens.charAt(wordStart - 1))) {
            --wordStart;
          }
          return REGEX_PRECEDER_KEYWORDS.contains(jsTokens.substring(wordStart));
      }
    }