return line.length();
}
int nextWhitespace = matcher.start();
+ int lastPunctuation = nextWhitespace;
+ while (isPunctuation(line.charAt(lastPunctuation - 1))) {
+ lastPunctuation -= 1;
+ }
+ if (lastPunctuation < nextWhitespace) {
+ return lastPunctuation;
+ }
int openParens = 0;
for (int i = 0; i < nextWhitespace; i++) {
switch (line.charAt(i)) {
return nextWhitespace;
}
+ private boolean isPunctuation(char character) {
+ return (character == '.') || (character == ',');
+ }
+
private static class NextLink {
private final int position;