From: axelcl <axelcl> Date: Fri, 24 Jun 2005 21:13:52 +0000 (+0000) Subject: Deleted unnecessary syntax highlighting rules X-Git-Url: http://secure.phpeclipse.com Deleted unnecessary syntax highlighting rules --- diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPCodeScanner.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPCodeScanner.java index 8a50ffd..be00721 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPCodeScanner.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/phpeditor/php/PHPCodeScanner.java @@ -37,7 +37,7 @@ import org.eclipse.jface.text.rules.WordRule; * PHP Code Scanner */ public class PHPCodeScanner extends AbstractJavaScanner { - + /** * Rule to detect java operators. * @@ -161,42 +161,7 @@ public class PHPCodeScanner extends AbstractJavaScanner { } } - protected class SingleQuoteStringRule implements IRule { - - /** Token to return for this rule */ - private final IToken fToken; - - public SingleQuoteStringRule(IToken token) { - fToken = token; - - } - - /* - * @see org.eclipse.jface.text.rules.IRule#evaluate(org.eclipse.jface.text.rules.ICharacterScanner) - */ - public IToken evaluate(ICharacterScanner scanner) { - - int character = scanner.read(); - if (character=='\'') { - - while (true) { - character = scanner.read(); - if (character == '\\') { - character = scanner.read(); - } else if (character == '\'') { - return fToken; - } - } - - } else { - scanner.unread(); - return Token.UNDEFINED; - } - } - - } - protected class AccentStringRule implements IRule { /** Token to return for this rule */ @@ -214,8 +179,8 @@ public class PHPCodeScanner extends AbstractJavaScanner { int character = scanner.read(); - if (character=='`') { - + if (character == '`') { + while (true) { character = scanner.read(); if (character == '\\') { @@ -223,44 +188,8 @@ public class PHPCodeScanner extends AbstractJavaScanner { } else if (character == '`') { return fToken; } - } - - } else { - scanner.unread(); - return Token.UNDEFINED; - } - } - - } - - protected class DoubleQuoteStringRule implements IRule { - - /** Token to return for this rule */ - private final IToken fToken; - - public DoubleQuoteStringRule(IToken token) { - fToken = token; - - } - - /* - * @see org.eclipse.jface.text.rules.IRule#evaluate(org.eclipse.jface.text.rules.ICharacterScanner) - */ - public IToken evaluate(ICharacterScanner scanner) { - - int character = scanner.read(); + } - if (character=='"') { - - while (true) { - character = scanner.read(); - if (character == '\\') { - character = scanner.read(); - } else if (character == '"') { - return fToken; - } - } - } else { scanner.unread(); return Token.UNDEFINED; @@ -268,7 +197,7 @@ public class PHPCodeScanner extends AbstractJavaScanner { } } - + private class PHPWordRule extends WordRule { private StringBuffer fBuffer = new StringBuffer(); @@ -291,7 +220,7 @@ public class PHPCodeScanner extends AbstractJavaScanner { return Token.UNDEFINED; } else { c = scanner.read(); - if (c == '=') { // <?= + if (c == '=') { // <?= return getToken(IPreferenceConstants.PHP_TAG); } if (c != 'p' && c != 'P') { @@ -399,13 +328,13 @@ public class PHPCodeScanner extends AbstractJavaScanner { List rules = new ArrayList(); Token token = getToken(IPreferenceConstants.PHP_SINGLELINE_COMMENT); // Add rule for single line comments. - rules.add(new EndOfLineRule("//", token)); //$NON-NLS-1$ - rules.add(new EndOfLineRule("#", token)); //$NON-NLS-1$ + // rules.add(new EndOfLineRule("//", token)); //$NON-NLS-1$ + // rules.add(new EndOfLineRule("#", token)); //$NON-NLS-1$ // Add rule for strings and character constants. -// token = getToken(IPreferenceConstants.PHP_STRING_SQ); -// rules.add(new SingleQuoteStringRule(token)); -// token = getToken(IPreferenceConstants.PHP_STRING_DQ); -// rules.add(new DoubleQuoteStringRule(token)); + // token = getToken(IPreferenceConstants.PHP_STRING_SQ); + // rules.add(new SingleQuoteStringRule(token)); + // token = getToken(IPreferenceConstants.PHP_STRING_DQ); + // rules.add(new DoubleQuoteStringRule(token)); rules.add(new AccentStringRule(token)); token = getToken(IPreferenceConstants.PHP_MULTILINE_COMMENT);