private int quoteEnd(int start) {
    char quote = s.charAt(start);
    assert quote == '\'' || quote == '"' || quote == '`';
    int i;
    for (i = start + 1; s.charAt(i) != quote; i++) {
      if (s.charAt(i) == '\\') {
        i++;
      }
    }
    return i + 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