* get the instatement indent for a comma * * @return is the indent to the second word on the line (the in statement indent). */
| 1613 | * @return is the indent to the second word on the line (the in statement indent). |
| 1614 | */ |
| 1615 | int ASBeautifier::getInStatementIndentComma(const string &line, size_t currPos) const |
| 1616 | { |
| 1617 | assert(line[currPos] == ','); |
| 1618 | |
| 1619 | // get first word on a line |
| 1620 | size_t indent = line.find_first_not_of(" \t"); |
| 1621 | if (indent == string::npos || !isLegalNameChar(line[indent])) |
| 1622 | return 0; |
| 1623 | |
| 1624 | // bypass first word |
| 1625 | for (; indent < currPos; indent++) |
| 1626 | { |
| 1627 | if (!isLegalNameChar(line[indent])) |
| 1628 | break; |
| 1629 | } |
| 1630 | indent++; |
| 1631 | if (indent >= currPos || indent < 4) |
| 1632 | return 0; |
| 1633 | |
| 1634 | // point to second word or assignment operator |
| 1635 | indent = line.find_first_not_of(" \t", indent); |
| 1636 | if (indent == string::npos || indent >= currPos) |
| 1637 | return 0; |
| 1638 | |
| 1639 | return indent; |
| 1640 | } |
| 1641 | |
| 1642 | /** |
| 1643 | * get the next word on a line |
nothing calls this directly
no outgoing calls
no test coverage detected