public boolean phpMode = false;
- public boolean phpExpressionTag = false;
+// public boolean phpExpressionTag = false;
+ int fFillerToken = TokenNameEOF;
// public Stack encapsedStringStack = null;
public char currentCharacter;
}
public int getNextToken() throws InvalidInputException {
- phpExpressionTag = false;
if (!phpMode) {
return getInlinedHTMLToken(currentPosition);
- }
- if (phpMode) {
+ } else {
+ if (fFillerToken!=TokenNameEOF) {
+ int tempToken;
+ tempToken = fFillerToken;
+ fFillerToken=TokenNameEOF;
+ return tempToken;
+ }
this.wasAcr = false;
if (diet) {
jumpOverMethodBody();
* @throws InvalidInputException
*/
private int getInlinedHTMLToken(int start) throws InvalidInputException {
+ boolean phpShortTag = false; // true, if <?= detected
if (currentPosition > source.length) {
currentPosition = source.length;
return TokenNameEOF;
if ((currentCharacter != 'P') && (currentCharacter != 'p')) {
if (currentCharacter != '=') { // <?=
currentPosition--;
+ phpShortTag = false;
} else {
- phpExpressionTag = true;
+ phpShortTag = true;
}
// <?
if (ignorePHPOneLiner) { // for CodeFormatter
if (lookAheadLinePHPTag() == TokenNameINLINE_HTML) {
phpMode = true;
+ if (phpShortTag) {
+ fFillerToken = TokenNameecho;
+ }
return TokenNameINLINE_HTML;
}
} else {
phpMode = true;
+ if (phpShortTag) {
+ fFillerToken = TokenNameecho;
+ }
return TokenNameINLINE_HTML;
}
} else {
- // boolean phpStart = (currentCharacter == 'P') ||
- // (currentCharacter == 'p');
- // if (phpStart) {
int test = getNextChar('H', 'h');
if (test >= 0) {
test = getNextChar('P', 'p');
}
/**
+ * check if the PHP is only in this line (for CodeFormatter)
+ *
* @return
*/
private int lookAheadLinePHPTag() {
- // check if the PHP is only in this line (for CodeFormatter)
int currentPositionInLine = currentPosition;
char previousCharInLine = ' ';
char currentCharInLine = ' ';