docs: function(context: ParserContext): ?Token {
      if (!context.reader.match("/")) return null;
  
      const previousNonWsToken = context.token(context.count() - 1);
      let previousToken = null;
      if (context.defaultData.text !== "")
        previousToken = context.createToken("default", context.defaultData.text);
  
      if (!previousToken) previousToken = previousNonWsToken;
  
      if (
        // The first token of the string
        previousToken !== undefined &&
        // Since Ruby doesn't require statement terminators, if the previous token
        // was whitespace and contained a newline, then we're good.
        (previousToken.name !== "default" ||
          previousToken.value.indexOf("\n") < 0)
      ) {
        // In these case the / stands for division.
        if (
          util.contains(["keyword", "ident", "number"], previousNonWsToken.name)
        )
          return null;
        if (
          previousNonWsToken.name === "punctuation" &&
          !util.contains(["(", "{", "[", ","], previousNonWsToken.value)
        )
          return null;
      }
  
      // read the regex literal
      let regexLiteral = context.reader.read();
      let charClass = false;
      while (!context.reader.isEOF()) {
        const next = context.reader.read();
        regexLiteral += next;
  
        if (next === "\\") regexLiteral += context.reader.read();
        else if (next === "[") charClass = true;
        else if (next === "]") charClass = false;
        else if (next === "/" && !charClass) break;
      }
  
      // Read the regex modifiers. For the sake of simplicity we accept all
      // characters, but currently only "ioxmusen" are supported.
      while (!context.reader.isEOF() && /[A-Za-z]/.test(context.reader.peek()))
        regexLiteral += context.reader.read();
  
      return context.createToken("regexLiteral", regexLiteral);
    }