From: axelcl Date: Fri, 24 Jun 2005 21:13:52 +0000 (+0000) Subject: Deleted unnecessary syntax highlighting rules X-Git-Url: http://secure.phpeclipse.com?hp=3e03708ddcce45dafdd5a36e9c3361ae65aaaec9 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 == '=') { //