}
if (token == Scanner.TokenNameEOF)
break;
+ if (token == Scanner.TokenNameHEREDOC || token == Scanner.TokenNameINLINE_HTML) {
+ // no indentation for heredocs and HTML !
+ outputCurrentTokenWithoutIndent(Scanner.TokenNameHEREDOC);
+ continue;
+ }
/*
* ## MODIFYING the indentation level before generating new lines and indentation in the output string
*/
// |= (15.25.2)
return "|="; //$NON-NLS-1$
case TokenNameDOT_EQUAL:
- // .=
+ // .=
return ".="; //$NON-NLS-1$
case TokenNameDOT:
// .
}
}
+ private void outputCurrentTokenWithoutIndent(int token) {
+ newLine(0);
+ formattedSource.append(scanner.source, scanner.startPosition, scanner.currentPosition - scanner.startPosition);
+ }
+
/**
* Appends <code>token</code> to the formatted output. <br>
* If it contains <code>\n</code>, append a LINE_SEPARATOR and indent after it.
//return (currentToken == TokenNameCOMMA || currentToken ==
// TokenNameSEMICOLON);
return currentToken != TokenNameif && currentToken != TokenNameLPAREN && currentToken != TokenNameNOT
- && currentToken != TokenNamewhile && currentToken != TokenNamefor && currentToken != TokenNameforeach
+ && currentToken != TokenNamewhile && currentToken != TokenNamefor && currentToken != TokenNameforeach
&& currentToken != TokenNameswitch;
}