function nextToken() {
    // Give the push back token if present.
    if (pushBackToken != null) {
      const c = pushBackToken;
      pushBackToken = null;
      return c;
    }

    // We're done. EOF.
    if (index >= text.length) {
      return EOF;
    }

    // Give the next charater.
    const chr = text.charAt(index++);
    goog.labs.format.csv.assertToken_(chr);

    // Check if this is a newline.  If so, give the new line sentinel.
    let isNewline = false;
    if (chr == '\n') {
      isNewline = true;
    } else if (chr == '\r') {
      // This is a '\r\n' newline. Treat as single token, go
      // forward two indicies.
      if (index < text.length && text.charAt(index) == '\n') {
        index++;
      }

      isNewline = true;
    }

    if (isNewline) {
      return NEWLINE;
    }

    return chr;
  }
@return {goog.labs.format.csv.Token} The next token in the stream.