Skip to content

Commit 30d9ade

Browse files
author
Felipe Zimmerle
committed
Fix macro expansion: Now support } and/or }% to close a variable
1 parent f441434 commit 30d9ade

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/macro_expansion.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ std::string MacroExpansion::expand(const std::string& input,
6262
variableValue = transaction->m_collections.resolveFirst(col, var);
6363
}
6464

65-
res.erase(start, end - start + 2);
65+
if (res[end - start + 2] == '%') {
66+
res.erase(start, end - start + 1);
67+
} else {
68+
res.erase(start, end - start + 2);
69+
}
6670
if (variableValue != NULL) {
6771
res.insert(start, *variableValue);
6872
}

0 commit comments

Comments
 (0)