}
token = 0;
}
- if (token == Scanner.TokenNameEOF)
+ if (token == Scanner.TokenNameEOF) {
break;
- if (token == Scanner.TokenNameHEREDOC || token == Scanner.TokenNameINLINE_HTML) {
+ } else if (token == Scanner.TokenNameHEREDOC) {
// no indentation for heredocs and HTML !
- outputCurrentTokenWithoutIndent(Scanner.TokenNameHEREDOC);
+ outputCurrentTokenWithoutIndent(Scanner.TokenNameHEREDOC, 0);
+ continue;
+ } else if (token == Scanner.TokenNameINLINE_HTML) {
+ // no indentation for heredocs and HTML !
+ int newLineCount = 1;
+ if (scanner.startPosition==0) {
+ newLineCount = 0;
+ }
+ outputCurrentTokenWithoutIndent(Scanner.TokenNameINLINE_HTML, newLineCount);
continue;
}
/*
}
}
- private void outputCurrentTokenWithoutIndent(int token) {
- newLine(0);
+ private void outputCurrentTokenWithoutIndent(int token, int newLineCount) {
+ newLine(newLineCount);
formattedSource.append(scanner.source, scanner.startPosition, scanner.currentPosition - scanner.startPosition);
}