Simplify \@ handling by using std::shared_ptr<std::string>

This has been relocated from macro.cpp to fstack.cpp, since both
MACRO and REPT/FOR nodes have their own unique `\@` values.
This commit is contained in:
ISSOtm
2024-03-20 17:19:07 +01:00
committed by Sylvie
parent 04405fb444
commit 52e8e1f9fc
5 changed files with 38 additions and 70 deletions

View File

@@ -591,7 +591,8 @@ static char const *readMacroArg(char name) {
char const *str = nullptr;
if (name == '@') {
str = macro_GetUniqueIDStr();
auto maybeStr = fstk_GetUniqueIDStr();
str = maybeStr ? maybeStr->c_str() : nullptr;
} else if (name == '#') {
str = macro_GetAllArgs();
} else if (name == '<') {