function readRegexp() {
    // JS-Interpreter change:
    // Removed redundant declaration of 'content' here.  Caused lint errors.
    // -- Neil Fraser, June 2022.
    var escaped;
    var inClass;
    var start = tokPos;
    for (;;) {
      if (tokPos >= inputLen) raise(start, "Unterminated regexp");
      var ch = input.charAt(tokPos);
      if (newline.test(ch)) raise(start, "Unterminated regexp");
      if (!escaped) {
        if (ch === "[") {
          inClass = true;
        } else if (ch === "]" && inClass) {
          inClass = false;
        } else if (ch === "/" && !inClass) {
          break;
        }
        escaped = ch === "\\";
      } else escaped = false;
      ++tokPos;
    }
    var content = input.slice(start, tokPos);
    ++tokPos;
    // Need to use `readWord1` because '\uXXXX' sequences are allowed
    // here (don't ask).
    var mods = readWord1();
    // JS-Interpreter change:
    // Acorn used to use 'gmsiy' to check for flags.  But 's' and 'y' are ES6.
    // -- Neil Fraser, December 2022.
    // https://github.com/acornjs/acorn/issues/1163
    if (mods && !/^[gmi]*$/.test(mods)) {
      raise(start, "Invalid regexp flag");
    }
    try {
      var value = new RegExp(content, mods);
    } catch (e) {
      if (e instanceof SyntaxError) raise(start, e.message);
      // JS-Interpreter change:
      // Acorn used to use raise(e) here which is incorrect.
      // -- Neil Fraser, July 2023.
      throw(e);
    }
    finishToken(_regexp, value);
  }
Parse a regular expression. Some context-awareness is necessary,
since a '/' inside a '[]' set does not end the expression.