X-Git-Url: http://secure.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Scanner.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Scanner.java index 041fd95..1ae5d16 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Scanner.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/Scanner.java @@ -804,65 +804,8 @@ public class Scanner implements IScanner, ITerminalSymbols { return TokenNameLPAREN; } public int getNextToken() throws InvalidInputException { - int htmlPosition = currentPosition; - try { - while (!phpMode) { - currentCharacter = source[currentPosition++]; - if (currentCharacter == '<') { - if (getNextChar('?')) { - currentCharacter = source[currentPosition++]; - if ((currentCharacter == ' ') - || Character.isWhitespace(currentCharacter)) { - // = 0) { - test = getNextChar('P', 'p'); - if (test >= 0) { - // ')) { phpMode = false; - return TokenNameStopPHP; + if (currentPosition==source.length) { + phpMode = true; + return TokenNameINLINE_HTML; + } + return getInlinedHTML(currentPosition - 2); } return TokenNameQUESTION; case ':' : @@ -1522,7 +1469,7 @@ public class Scanner implements IScanner, ITerminalSymbols { if (getNextChar('>')) { startPosition = currentPosition - 2; phpMode = false; - return TokenNameStopPHP; + return TokenNameINLINE_HTML; } } //get the next char @@ -1702,7 +1649,6 @@ public class Scanner implements IScanner, ITerminalSymbols { int oldPosition = currentPosition; try { currentCharacter = source[currentPosition++]; - if (isPHPIdentifierStart(currentCharacter)) { return scanIdentifierOrKeyword(true); } else { @@ -1727,6 +1673,63 @@ public class Scanner implements IScanner, ITerminalSymbols { } return TokenNameEOF; } + /** + * @return @throws + * InvalidInputException + */ + private int getInlinedHTML(int start) throws InvalidInputException { + // int htmlPosition = start; + if (currentPosition>source.length) { + currentPosition = source.length; + return TokenNameEOF; + } + startPosition = start; + try { + while (!phpMode) { + currentCharacter = source[currentPosition++]; + if (currentCharacter == '<') { + if (getNextChar('?')) { + currentCharacter = source[currentPosition++]; + if ((currentCharacter == ' ') + || Character.isWhitespace(currentCharacter)) { + // = 0) { + test = getNextChar('P', 'p'); + if (test >= 0) { + //