Skip to content

Commit

Permalink
parse prefixed tags and traces
Browse files Browse the repository at this point in the history
  • Loading branch information
flammie committed Nov 2, 2023
1 parent 4629a43 commit d0647bf
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/normaliser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ void Normaliser::run(std::istream& is, std::ostream& os) {
bool in_quot = false;
bool in_at = false;
bool in_bracket = false;
bool in_suffix = false;
for (auto& c : result[0].str()) {
if (c == '\t') {
continue;
Expand All @@ -196,6 +197,7 @@ void Normaliser::run(std::istream& is, std::ostream& os) {
}
else if (in_quot && (c == '"')) {
in_quot = false;
in_suffix = true;
}
else if (c == '@') {
in_at = true;
Expand All @@ -211,15 +213,26 @@ void Normaliser::run(std::istream& is, std::ostream& os) {
break;
}
else if (c == ' ') {
if (in_suffix) {
in_suffix = false;
current_token << "+";
continue;
}
auto t = current_token.str();
if ((t.find("SELECT:") != string::npos) ||
(t.find("MAP:") != string::npos) ||
(t.find("SETPARENT:") != string::npos)) {
current_token.str("");
break;
}
if (t.find("/") == string::npos) {
regentags += current_token.str();
}
current_token.str("");
current_token << "+";
in_at = false;
}
else if (in_quot || in_at || in_bracket) {
else if (in_quot || in_at || in_bracket || in_suffix) {
continue;
}
else {
Expand Down

0 comments on commit d0647bf

Please sign in to comment.