mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Refactor macro args to be owned collectively by their fstack contexts
This commit is contained in:
@@ -522,7 +522,7 @@ macro_args:
|
||||
}
|
||||
| macro_args STRING {
|
||||
$$ = std::move($1);
|
||||
$$->append(std::make_shared<std::string>($2));
|
||||
$$->appendArg(std::make_shared<std::string>($2));
|
||||
}
|
||||
;
|
||||
|
||||
@@ -843,10 +843,18 @@ assert:
|
||||
|
||||
shift:
|
||||
POP_SHIFT {
|
||||
macro_ShiftCurrentArgs(1);
|
||||
if (MacroArgs *macroArgs = fstk_GetCurrentMacroArgs(); macroArgs) {
|
||||
macroArgs->shiftArgs(1);
|
||||
} else {
|
||||
::error("Cannot shift macro arguments outside of a macro\n");
|
||||
}
|
||||
}
|
||||
| POP_SHIFT const {
|
||||
macro_ShiftCurrentArgs($2);
|
||||
if (MacroArgs *macroArgs = fstk_GetCurrentMacroArgs(); macroArgs) {
|
||||
macroArgs->shiftArgs($2);
|
||||
} else {
|
||||
::error("Cannot shift macro arguments outside of a macro\n");
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user