public ICompilationUnit compilationUnit = null;
/**
- * Determines if the specified character is permissible as the first character in a PHP identifier or
- * variable
+ * Determines if the specified character is permissible as the first character in a PHP identifier or variable
*
* The '$' character for PHP variables is regarded as a correct first character !
- *
+ *
*/
public static boolean isPHPIdentOrVarStart(char ch) {
- return Character.isLetter(ch) || (ch == '$') ||(ch == '_') || (0x7F <= ch && ch <= 0xFF);
+ return Character.isLetter(ch) || (ch == '$') || (ch == '_') || (0x7F <= ch && ch <= 0xFF);
}
-
+
/**
* Determines if the specified character is permissible as the first character in a PHP identifier.
*
}
return result;
}
-
+
public final char[] getRawTokenSourceEnd() {
- int length = this.eofPosition - this.currentPosition - 1;
- char[] sourceEnd = new char[length];
- System.arraycopy(this.source, this.currentPosition, sourceEnd, 0, length);
- return sourceEnd;
-}
+ int length = this.eofPosition - this.currentPosition - 1;
+ char[] sourceEnd = new char[length];
+ System.arraycopy(this.source, this.currentPosition, sourceEnd, 0, length);
+ return sourceEnd;
+ }
+
public int getCurrentTokenStartPosition() {
return this.startPosition;
}
withoutUnicodePtr--;
}
}
+ } else if ((currentCharacter == '\r') || (currentCharacter == '\n')) {
+ if (recordLineSeparator) {
+ pushLineSeparator();
+ }
}
// consume next character
unicodeAsBackSlash = false;
}
}
break;
+ case '\r':
+ case '\n':
+ if (recordLineSeparator) {
+ pushLineSeparator();
+ }
+ break;
case '$':
if (isPHPIdentifierStart(source[currentPosition]) || source[currentPosition] == '{') {
currentPosition--;