| 76 | } |
| 77 | |
| 78 | void cmRST::ProcessModule(std::istream& is) |
| 79 | { |
| 80 | std::string line; |
| 81 | std::string rst; |
| 82 | while (cmSystemTools::GetLineFromStream(is, line)) { |
| 83 | if (!rst.empty() && rst != "#") { |
| 84 | // Bracket mode: check for end bracket |
| 85 | std::string::size_type pos = line.find(rst); |
| 86 | if (pos == std::string::npos) { |
| 87 | this->ProcessLine(line); |
| 88 | } else { |
| 89 | if (line[0] != '#') { |
| 90 | line.resize(pos); |
| 91 | this->ProcessLine(line); |
| 92 | } |
| 93 | rst.clear(); |
| 94 | this->Reset(); |
| 95 | this->OutputLinePending = true; |
| 96 | } |
| 97 | } else { |
| 98 | // Line mode: check for .rst start (bracket or line) |
| 99 | if (rst == "#") { |
| 100 | if (line == "#") { |
| 101 | this->ProcessLine(""); |
| 102 | continue; |
| 103 | } |
| 104 | if (cmHasLiteralPrefix(line, "# ")) { |
| 105 | line.erase(0, 2); |
| 106 | this->ProcessLine(line); |
| 107 | continue; |
| 108 | } |
| 109 | rst.clear(); |
| 110 | this->Reset(); |
| 111 | this->OutputLinePending = true; |
| 112 | } |
| 113 | if (line == "#.rst:") { |
| 114 | rst = "#"; |
| 115 | } else if (this->ModuleRST.find(line)) { |
| 116 | rst = "]" + this->ModuleRST.match(1) + "]"; |
| 117 | } |
| 118 | } |
| 119 | } |
| 120 | if (rst == "#") { |
| 121 | this->Reset(); |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | void cmRST::Reset() |
| 126 | { |
no test coverage detected