int tokenEnd(int start) {
    if (start >= s.length()) {
      return s.length();
    }
    switch (s.charAt(start)) {
      case ' ':
      case '\n':
        return spaceEnd(start);
      case '/':
        if (s.charAt(start + 1) == '*') {
          return blockCommentEnd(start);
        } else if (s.charAt(start + 1) == '/') {
          return lineCommentEnd(start);
        } else {
          return start + 1;
        }
      case '\'':
      case '"':
      case '`':
        return quoteEnd(start);
      default:
        // Every other character is considered to be its own token.
        return start + 1;
    }
  }
Returns the position at which this token ends and the next token begins.
value/src/main/java/com/google/auto/value/processor/JavaScanner.java