37 lines
727 B
C++
37 lines
727 B
C++
|
#if 0
|
||
|
|
||
|
struct Markup {
|
||
|
//... TODO
|
||
|
};
|
||
|
|
||
|
struct MarkupInstance {
|
||
|
std::pair<unsigned, unsigned> range;
|
||
|
std::string effect; //TEMP
|
||
|
};
|
||
|
|
||
|
|
||
|
std::vector<int> discards;
|
||
|
for (int i = 0; i < s.length(); i++) {
|
||
|
if (s[i] == ESCAPE) {
|
||
|
if (DIALOGUE_ESCAPED_SINGLE.accept.find(s[i]) != std::string::npos) {
|
||
|
discards.push_back(i++);
|
||
|
}
|
||
|
else
|
||
|
throw std::runtime_error("Unrecognized escape sequence");
|
||
|
}
|
||
|
}
|
||
|
std::string new_s{ s };
|
||
|
for (int i = 0; i < discards.size(); i++) {
|
||
|
new_s.erase(discards[i] - i, 1);
|
||
|
discards[i] -= i; // New indices become the positions of the escaped characters
|
||
|
}
|
||
|
// TODO
|
||
|
for (int i = 0; i < s.length(); i++) {
|
||
|
if (!discards.empty() && discards[0] < i) {
|
||
|
discards.erase(discards.begin());
|
||
|
}
|
||
|
|
||
|
}
|
||
|
#endif
|
||
|
|