currentLineIndentationLevel += constructionsCount;
// An InvalidInputException exception might cause the termination of this
// loop.
+ int arrayDeclarationCount=0;
+ int[] arrayDeclarationParenthesis=new int[10];
try {
while (true) {
// Get the next token. Catch invalid input and output it
else
openParenthesis[0]++;
pendingSpace = false;
+ // recognize array declaration for nice output
+ if (previousCompilableToken == TokenNamearray) {
+ arrayDeclarationCount++;
+ arrayDeclarationParenthesis[arrayDeclarationCount]=openParenthesis[openParenthesisCount];
+ indentationLevel++;
+ pendingNewLines=1;
+ }
//S }
break;
case TokenNameRPAREN:
+ // check for closing array declaration
+ if (arrayDeclarationCount>0) {
+ if (arrayDeclarationParenthesis[arrayDeclarationCount]==openParenthesis[openParenthesisCount]) {
+ newLine(1);
+ indentationLevel--;
+ currentLineIndentationLevel = indentationLevel;
+ pendingNewLines = 0;
+ arrayDeclarationCount--;
+ }
+ }
// Decrease the parenthesis count
// if there is no more unclosed parenthesis,
// a new line and indent may be append (depending on the next
pendingSpace = false;
break;
case TokenNameCOMMA:
+ pendingSpace = false;
+ if (arrayDeclarationCount>0) {
+ pendingNewLines=1;
+ }
+ break;
case TokenNameDOT:
pendingSpace = false;
break;