From e6c124feef4a785a7352f1fededdb766c87e18e3 Mon Sep 17 00:00:00 2001 From: axelcl Date: Fri, 24 Jun 2005 21:09:55 +0000 Subject: [PATCH] Fixed syntaxhiglighting for single line comments. Example:

This is an example.

--- .../internal/ui/text/FastJavaPartitionScanner.java | 22 ++++++++++++++++++- 1 files changed, 20 insertions(+), 2 deletions(-) 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 663757f..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 @@ -79,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; @@ -180,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) { -- 1.7.1