* convert a tab to spaces. * charNum points to the current character to convert to spaces. * tabIncrementIn is the increment that must be added for tab indent characters * to get the correct column for the current tab. * replaces the tab in currentLine with the required number of spaces. * replaces the value of currentChar. */
| 4495 | * replaces the value of currentChar. |
| 4496 | */ |
| 4497 | void ASFormatter::convertTabToSpaces() |
| 4498 | { |
| 4499 | assert(currentLine[charNum] == '\t'); |
| 4500 | |
| 4501 | // do NOT replace if in quotes |
| 4502 | if (isInQuote || isInQuoteContinuation) |
| 4503 | return; |
| 4504 | |
| 4505 | size_t tabSize = getTabLength(); |
| 4506 | size_t numSpaces = tabSize - ((tabIncrementIn + charNum) % tabSize); |
| 4507 | currentLine.replace(charNum, 1, numSpaces, ' '); |
| 4508 | currentChar = currentLine[charNum]; |
| 4509 | } |
| 4510 | |
| 4511 | /** |
| 4512 | * is it ok to break this block? |
nothing calls this directly
no outgoing calls
no test coverage detected