}
public int getNextToken() throws InvalidInputException {
+
try {
+ int htmlPosition = currentPosition;
while (!phpMode) {
- startPosition = currentPosition;
currentCharacter = source[currentPosition++];
if (currentCharacter == '<') {
if (getNextChar('?')) {
// <?
startPosition = currentPosition;
phpMode = true;
+ if (tokenizeWhiteSpace) {
+ // && (whiteStart != currentPosition - 1)) {
+ // reposition scanner in case we are interested by spaces as tokens
+ startPosition = htmlPosition;
+ return TokenNameHTML;
+ }
} else {
boolean phpStart =
(currentCharacter == 'P') || (currentCharacter == 'p');
// <?PHP <?php
startPosition = currentPosition;
phpMode = true;
+
+ if (tokenizeWhiteSpace) {
+ // && (whiteStart != currentPosition - 1)) {
+ // reposition scanner in case we are interested by spaces as tokens
+ startPosition = htmlPosition;
+ return TokenNameHTML;
+ }
}
}
}