* than with a start-comment token.
*/
p = p.getPrevious();
}
while (p != null) {
Token t = p.token;
/*
* This is needed to cover cases like the following:
*
* <trans>"abc"</trans
*
* At this point he currect partitioning will end with
*
* OPERATOR("<") OPERATOR("/") SOURCE_PATH("trans")
*
* When the final ">" is typed, we need to go back all the way to the string literal
* "abc" in order to correctly detect the new END_TRANS token.
*
* Another example:
*
* <trans>"abc"</tra ns> [note the space in the closing trans]
*
* At this point the current partitioning will end with
*
* OPERATOR("<") OPERATOR("/") SOURCE_PATH("tra") WHITESPACE(" ") SOURCE_PATH("ns") OPERATOR(">")
*
* When the erroneous space is deleted we must again walk back to the string literal "abc"
* as a starting point.
*/
if (!t.isWhitespace() && t != SOURCE_PATH && t != OPERATOR && t != WORD_TOKEN) {
break;
}
p = p.getPrevious();
}
return p;