* Check to see if this is an EXEC SQL statement. * * @param line a reference to the line to indent. * @param index the current line index. * @return true if the statement is EXEC SQL. */
| 5579 | * @return true if the statement is EXEC SQL. |
| 5580 | */ |
| 5581 | bool ASFormatter::isExecSQL(string &line, size_t index) const |
| 5582 | { |
| 5583 | if (line[index] != 'e' && line[index] != 'E') // quick check to reject most |
| 5584 | return false; |
| 5585 | string word; |
| 5586 | if (isCharPotentialHeader(line, index)) |
| 5587 | word = getCurrentWord(line, index); |
| 5588 | for (size_t i = 0; i < word.length(); i++) |
| 5589 | word[i] = (char) toupper(word[i]); |
| 5590 | if (word != "EXEC") |
| 5591 | return false; |
| 5592 | size_t index2 = index + word.length(); |
| 5593 | index2 = line.find_first_not_of(" \t", index2); |
| 5594 | if (index2 == string::npos) |
| 5595 | return false; |
| 5596 | word.erase(); |
| 5597 | if (isCharPotentialHeader(line, index2)) |
| 5598 | word = getCurrentWord(line, index2); |
| 5599 | for (size_t i = 0; i < word.length(); i++) |
| 5600 | word[i] = (char) toupper(word[i]); |
| 5601 | if (word != "SQL") |
| 5602 | return false; |
| 5603 | return true; |
| 5604 | } |
| 5605 | |
| 5606 | /** |
| 5607 | * The continuation lines must be adjusted so the leading spaces |
nothing calls this directly
no outgoing calls
no test coverage detected