From: khartlage Date: Thu, 20 Mar 2003 20:48:53 +0000 (+0000) Subject: php formatter based on the JDT java formatter (very early version) X-Git-Url: http://secure.phpeclipse.com?hp=3c5d2d3ecda734c6d35be223939287e8e805e8fc php formatter based on the JDT java formatter (very early version) --- 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 83f8e87..0dacb72 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 @@ -719,9 +719,8 @@ public class Scanner implements IScanner, ITerminalSymbols { } public int getNextToken() throws InvalidInputException { - + int htmlPosition = currentPosition; try { - int htmlPosition = currentPosition; while (!phpMode) { currentCharacter = source[currentPosition++]; if (currentCharacter == '<') { @@ -773,6 +772,11 @@ public class Scanner implements IScanner, ITerminalSymbols { } } //-----------------end switch while try-------------------- catch (IndexOutOfBoundsException e) { + if (tokenizeWhiteSpace) { + // && (whiteStart != currentPosition - 1)) { + // reposition scanner in case we are interested by spaces as tokens + startPosition = htmlPosition; + } return TokenNameEOF; }