equal
deleted
inserted
replaced
200 } |
200 } |
201 |
201 |
202 std::string readUntil(const std::string& until, bool* found = nullptr) { |
202 std::string readUntil(const std::string& until, bool* found = nullptr) { |
203 std::stringstream result; |
203 std::stringstream result; |
204 |
204 |
205 for (char ch = peek(); input.good() && !oneOf(ch, until); ch = peek()) { |
205 for (char ch = peek(); input.good(); ch = peek()) { |
206 if (allowLineContinuationsWithEscaping && ch == '\\') { |
206 if (allowLineContinuationsWithSpace && ch == '\n') { |
|
207 get(); |
|
208 ch = peek(); |
|
209 if (ch == ' ') get(); |
|
210 else if (ch == std::istream::traits_type::eof()) break; |
|
211 else { |
|
212 if (found) *found = true; |
|
213 return result.str(); |
|
214 } |
|
215 } else if (oneOf(ch, until)) { |
|
216 break; |
|
217 } else if (allowLineContinuationsWithEscaping && ch == '\\') { |
207 get(); |
218 get(); |
208 ch = get(); |
219 ch = get(); |
209 if (oneOf(ch, until) && ch == '\n') processContinuingLine(result); |
220 if (oneOf(ch, until) && ch == '\n') processContinuingLine(result); |
210 else if (oneOf(ch, until)) result.put(ch); |
221 else if (oneOf(ch, until)) result.put(ch); |
211 else if (ch == std::istream::traits_type::eof()) break; |
222 else if (ch == std::istream::traits_type::eof()) break; |