Contributors:
Igor Malinin - initial contribution
- $Id: PHPPartitionScanner.java,v 1.33 2005-10-10 19:56:02 axelcl Exp $
+ $Id: PHPPartitionScanner.java,v 1.35 2007-03-17 14:07:31 axelcl Exp $
**********************************************************************/
package net.sourceforge.phpeclipse.phpeditor.php;
import org.eclipse.jface.text.rules.Token;
/**
- *
- *
+ *
+ *
* @author Igor Malinin
*/
public class PHPPartitionScanner implements IPartitionTokenScanner {
if (position >= end) {
return false;
}
- ch = document.getChar(position++); // ignore escaped character
+ ch = document.getChar(position++); // ignore escaped
+ // character
} else if (ch == '"') {
return true;
}
if (position >= end) {
return false;
}
- ch = document.getChar(position++); // ignore escaped character
+ ch = document.getChar(position++); // ignore escaped
+ // character
} else if (ch == '\'') {
return true;
}
return false;
}
ch = document.getChar(position++);
+ // #1493165 start
+ while (ch == ' ') {
+ if (position >= end) {
+ return false;
+ }
+ ch = document.getChar(position++);
+ }
+ // #1493165 end
if (!Scanner.isPHPIdentifierStart(ch)) {
return false;
}
if (pos == heredocIdent.length) {
return true;
}
- ch = document.getChar(position++); // ignore escaped character
+ ch = document.getChar(position++); // ignore escaped
+ // character
if (ch != heredocIdent[pos]) {
break;
}
/*
* @see org.eclipse.jface.text.rules.IPartitionTokenScanner
*/
- public void setPartialRange(IDocument document, int offset, int length, String contentType, int partitionOffset) {
+ public void setPartialRange(IDocument document, int offset, int length,
+ String contentType, int partitionOffset) {
// state = STATE_DEFAULT;
if (partitionOffset > -1) {
int delta = offset - partitionOffset;