* format quote body * the calling function should have a continue statement after calling this method */
| 5033 | * the calling function should have a continue statement after calling this method |
| 5034 | */ |
| 5035 | void ASFormatter::formatQuoteBody() |
| 5036 | { |
| 5037 | assert(isInQuote); |
| 5038 | |
| 5039 | if (isSpecialChar) |
| 5040 | { |
| 5041 | isSpecialChar = false; |
| 5042 | } |
| 5043 | else if (currentChar == '\\' && !isInVerbatimQuote) |
| 5044 | { |
| 5045 | if (peekNextChar() == ' ') // is this '\' at end of line |
| 5046 | haveLineContinuationChar = true; |
| 5047 | else |
| 5048 | isSpecialChar = true; |
| 5049 | } |
| 5050 | else if (isInVerbatimQuote && currentChar == '"') |
| 5051 | { |
| 5052 | if (peekNextChar() == '"') // check consecutive quotes |
| 5053 | { |
| 5054 | appendSequence("\"\""); |
| 5055 | goForward(1); |
| 5056 | return; |
| 5057 | } |
| 5058 | else |
| 5059 | { |
| 5060 | isInQuote = false; |
| 5061 | isInVerbatimQuote = false; |
| 5062 | } |
| 5063 | } |
| 5064 | else if (quoteChar == currentChar) |
| 5065 | { |
| 5066 | isInQuote = false; |
| 5067 | } |
| 5068 | |
| 5069 | appendCurrentChar(); |
| 5070 | |
| 5071 | // append the text to the ending quoteChar or an escape sequence |
| 5072 | // tabs in quotes are NOT changed by convert-tabs |
| 5073 | if (isInQuote && currentChar != '\\') |
| 5074 | { |
| 5075 | while (charNum + 1 < (int) currentLine.length() |
| 5076 | && currentLine[charNum + 1] != quoteChar |
| 5077 | && currentLine[charNum + 1] != '\\') |
| 5078 | { |
| 5079 | currentChar = currentLine[++charNum]; |
| 5080 | appendCurrentChar(); |
| 5081 | } |
| 5082 | } |
| 5083 | } |
| 5084 | |
| 5085 | /** |
| 5086 | * format a quote opener |
nothing calls this directly
no outgoing calls
no test coverage detected