* remove whitepace and add indentation for an array run-in. */
| 4399 | * remove whitepace and add indentation for an array run-in. |
| 4400 | */ |
| 4401 | void ASFormatter::formatArrayRunIn() |
| 4402 | { |
| 4403 | assert(isBracketType(bracketTypeStack->back(), ARRAY_TYPE)); |
| 4404 | |
| 4405 | // make sure the bracket is broken |
| 4406 | if (formattedLine.find_first_not_of(" \t{") != string::npos) |
| 4407 | return; |
| 4408 | |
| 4409 | size_t lastText = formattedLine.find_last_not_of(" \t"); |
| 4410 | if (lastText == string::npos || formattedLine[lastText] != '{') |
| 4411 | return; |
| 4412 | |
| 4413 | // check for extra whitespace |
| 4414 | if (formattedLine.length() > lastText + 1 |
| 4415 | && formattedLine.find_first_not_of(" \t", lastText + 1) == string::npos) |
| 4416 | formattedLine.erase(lastText + 1); |
| 4417 | |
| 4418 | if (getIndentString() == "\t") |
| 4419 | { |
| 4420 | appendChar('\t', false); |
| 4421 | horstmannIndentChars = 2; // one for { and one for tab |
| 4422 | } |
| 4423 | else |
| 4424 | { |
| 4425 | int indent = getIndentLength(); |
| 4426 | formattedLine.append(indent - 1, ' '); |
| 4427 | horstmannIndentChars = indent; |
| 4428 | } |
| 4429 | isInHorstmannRunIn = true; |
| 4430 | isInLineBreak = false; |
| 4431 | } |
| 4432 | |
| 4433 | /** |
| 4434 | * delete a bracketTypeStack vector object |
nothing calls this directly
no outgoing calls
no test coverage detected