import java.util.Vector;
import net.sourceforge.phpdt.internal.ui.text.AbstractJavaScanner;
-import net.sourceforge.phpdt.internal.ui.text.JavaColorManager;
import net.sourceforge.phpdt.ui.text.IColorManager;
import net.sourceforge.phpdt.ui.text.IJavaColorConstants;
-import net.sourceforge.phpeclipse.IPreferenceConstants;
-import net.sourceforge.phpeclipse.PHPeclipsePlugin;
import net.sourceforge.phpeclipse.phpeditor.PHPSyntaxRdr;
import net.sourceforge.phpeclipse.phpeditor.util.PHPWhitespaceDetector;
import net.sourceforge.phpeclipse.phpeditor.util.PHPWordDetector;
import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
-import org.eclipse.jface.text.TextAttribute;
-import org.eclipse.jface.text.rules.EndOfLineRule;
-import org.eclipse.jface.text.rules.ICharacterScanner;
-import org.eclipse.jface.text.rules.IRule;
-import org.eclipse.jface.text.rules.IToken;
-import org.eclipse.jface.text.rules.IWordDetector;
-import org.eclipse.jface.text.rules.MultiLineRule;
-import org.eclipse.jface.text.rules.SingleLineRule;
-import org.eclipse.jface.text.rules.Token;
-import org.eclipse.jface.text.rules.WhitespaceRule;
-import org.eclipse.jface.text.rules.WordRule;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
+import org.eclipse.jface.text.rules.*;
/**
* PHP Code Scanner
Token token= getToken(IJavaColorConstants.PHP_SINGLE_LINE_COMMENT);
// Add rule for single line comments.
rules.add(new EndOfLineRule("//", token)); //$NON-NLS-1$
- rules.add(new EndOfLineRule("#", token));
+ rules.add(new EndOfLineRule("#", token)); //$NON-NLS-1$
// Add rule for strings and character constants.
token= getToken(IJavaColorConstants.PHP_STRING);
rules.add(new MultiLineRule("\"", "\"", token, '\\')); //$NON-NLS-2$ //$NON-NLS-1$
- rules.add(new SingleLineRule("'", "'", token, '\\')); //$NON-NLS-2$ //$NON-NLS-1$
+ rules.add(new MultiLineRule("`", "`", token, '\\')); //$NON-NLS-2$ //$NON-NLS-1$
+ rules.add(new MultiLineRule("'", "'", token, '\\')); //$NON-NLS-2$ //$NON-NLS-1$
+
+ //previous version
+ //rules.add(new SingleLineRule("'", "'", token, '\\')); //$NON-NLS-2$ //$NON-NLS-1$
+
+
token= getToken(IJavaColorConstants.PHP_MULTI_LINE_COMMENT);
- rules.add(new MultiLineRule("/*", "*/", token));
+ rules.add(new MultiLineRule("/*", "*/", token)); //$NON-NLS-2$ //$NON-NLS-1$
// Add generic whitespace rule.
rules.add(new WhitespaceRule(new PHPWhitespaceDetector()));
// Add word rule for keywords, types, and constants.
Token constant= getToken(IJavaColorConstants.PHP_CONSTANT);
PHPSyntaxRdr.readInSyntax();
Vector buffer = PHPSyntaxRdr.getsyntaxdata();
- String strbuffer = null;
+ // String strbuffer = null; unused
PHPElement elbuffer = null;
while ((buffer != null)
&& (!buffer.isEmpty()
wordRule.addWord(elbuffer.getName(), constant);
}
rules.add(wordRule);
- IRule[] result = new IRule[rules.size()];
+ // IRule[] result = new IRule[rules.size()];unused
// rules.toArray(result);
// setRules(result);
return rules;