X-Git-Url: http://secure.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/FastJavaPartitionScanner.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/FastJavaPartitionScanner.java index ed3302f..f902c59 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/FastJavaPartitionScanner.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/ui/text/FastJavaPartitionScanner.java @@ -17,7 +17,6 @@ import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.rules.ICharacterScanner; import org.eclipse.jface.text.rules.IPartitionTokenScanner; import org.eclipse.jface.text.rules.IToken; -import org.eclipse.jface.text.rules.RuleBasedPartitionScanner; import org.eclipse.jface.text.rules.Token; /** @@ -43,7 +42,7 @@ public class FastJavaPartitionScanner implements IPartitionTokenScanner, IPHPPar // beginning of prefixes and postfixes private static final int NONE = 0; - private static final int BACKSLASH = 1; // postfix for STRING and CHARACTER + private static final int BACKSLASH = 1; // postfix for STRING_DQ and CHARACTER private static final int SLASH = 2; // prefix for SINGLE_LINE or MULTI_LINE or JAVADOC @@ -53,7 +52,7 @@ public class FastJavaPartitionScanner implements IPartitionTokenScanner, IPHPPar private static final int STAR = 5; // postfix for MULTI_LINE_COMMENT or JAVADOC - private static final int CARRIAGE_RETURN = 6; // postfix for STRING, CHARACTER and SINGLE_LINE_COMMENT + private static final int CARRIAGE_RETURN = 6; // postfix for STRING_DQ, CHARACTER and SINGLE_LINE_COMMENT /** The scanner. */ private final BufferedDocumentScanner fScanner = new BufferedDocumentScanner(1000); // faster implementation @@ -80,8 +79,13 @@ public class FastJavaPartitionScanner implements IPartitionTokenScanner, IPHPPar private int fJavaLength; - private final IToken[] fTokens = new IToken[] { new Token(null), new Token(PHP_SINGLELINE_COMMENT), - new Token(PHP_MULTILINE_COMMENT), new Token(PHP_PHPDOC_COMMENT), new Token(PHP_STRING_DQ), new Token(PHP_STRING_SQ) }; + private final IToken[] fTokens = new IToken[] { + new Token(null), + new Token(PHP_SINGLELINE_COMMENT), + new Token(PHP_MULTILINE_COMMENT), + new Token(PHP_PHPDOC_COMMENT), + new Token(PHP_STRING_DQ), + new Token(PHP_STRING_SQ) }; public FastJavaPartitionScanner(boolean emulate) { fEmulate = emulate; @@ -181,6 +185,19 @@ public class FastJavaPartitionScanner implements IPartitionTokenScanner, IPHPPar continue; } + case '?': + if (fState == SINGLE_LINE_COMMENT) { + int nextch = fScanner.read(); + if (nextch == '>') { + //

This is an example.

+ fTokenLength--; + fScanner.unread(); + fScanner.unread(); + return postFix(fState); + } + fScanner.unread(); + } + default: if (!fEmulate && fLast == CARRIAGE_RETURN) { switch (fState) {