/*******************************************************************************
* Copyright (c) 2000, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
+ * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
private int fJavaLength;
- private final IToken[] fTokens = new IToken[] { new Token(null), new Token(PHP_SINGLELINE_COMMENT),
- new Token(PHP_MULTILINE_COMMENT), new Token(PHP_PHPDOC_COMMENT), new Token(PHP_STRING_DQ), new Token(PHP_STRING_SQ) };
+ private final IToken[] fTokens = new IToken[] {
+ new Token(null),
+ new Token(PHP_SINGLELINE_COMMENT),
+ new Token(PHP_MULTILINE_COMMENT),
+ new Token(PHP_PHPDOC_COMMENT),
+ new Token(PHP_STRING_DQ),
+ new Token(PHP_STRING_SQ) };
public FastJavaPartitionScanner(boolean emulate) {
fEmulate = emulate;
continue;
}
+ case '?':
+ if (fState == SINGLE_LINE_COMMENT) {
+ int nextch = fScanner.read();
+ if (nextch == '>') {
+ // <h1>This is an <?php # echo 'simple' ?> example.</h1>
+ fTokenLength--;
+ fScanner.unread();
+ fScanner.unread();
+ return postFix(fState);
+ }
+ fScanner.unread();
+ }
+
default:
if (!fEmulate && fLast == CARRIAGE_RETURN) {
switch (fState) {
// fLast= (fLast == BACKSLASH) ? NONE : BACKSLASH;
// fTokenLength++;
// break;
- //
+ //
// case '\'':
// if (fLast != BACKSLASH) {
// return postFix(CHARACTER);
- //
+ //
// } else {
// consume();
// break;
// }
- //
+ //
// default:
// consume();
// break;
else if (contentType.equals(PHP_STRING_DQ))
return STRING_DQ;
+
else if (contentType.equals(PHP_STRING_SQ))
return STRING_SQ;
// else if (contentType.equals(JAVA_CHARACTER))