mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-26 21:12:07 +00:00
Refactor macro args to be owned collectively by their fstack contexts
This commit is contained in:
@@ -54,6 +54,7 @@ struct MacroArgs;
|
||||
void fstk_DumpCurrent();
|
||||
std::shared_ptr<FileStackNode> fstk_GetFileStack();
|
||||
std::shared_ptr<std::string> fstk_GetUniqueIDStr();
|
||||
MacroArgs *fstk_GetCurrentMacroArgs();
|
||||
|
||||
void fstk_AddIncludePath(std::string const &path);
|
||||
void fstk_SetPreIncludeFile(std::string const &path);
|
||||
@@ -61,7 +62,7 @@ std::optional<std::string> fstk_FindFile(std::string const &path);
|
||||
|
||||
bool yywrap();
|
||||
void fstk_RunInclude(std::string const &path);
|
||||
void fstk_RunMacro(std::string const ¯oName, std::shared_ptr<MacroArgs> args);
|
||||
void fstk_RunMacro(std::string const ¯oName, std::shared_ptr<MacroArgs> macroArgs);
|
||||
void fstk_RunRept(uint32_t count, int32_t reptLineNo, char const *body, size_t size);
|
||||
void fstk_RunFor(
|
||||
std::string const &symName,
|
||||
|
||||
@@ -12,15 +12,13 @@ struct MacroArgs {
|
||||
unsigned int shift;
|
||||
std::vector<std::shared_ptr<std::string>> args;
|
||||
|
||||
void append(std::shared_ptr<std::string> arg);
|
||||
uint32_t nbArgs() const { return args.size() - shift; }
|
||||
std::shared_ptr<std::string> getArg(uint32_t i) const;
|
||||
std::shared_ptr<std::string> getAllArgs() const;
|
||||
|
||||
void appendArg(std::shared_ptr<std::string> arg);
|
||||
void shiftArgs(int32_t count);
|
||||
};
|
||||
|
||||
bool macro_HasCurrentArgs();
|
||||
std::shared_ptr<MacroArgs> macro_GetCurrentArgs();
|
||||
void macro_UseNewArgs(std::shared_ptr<MacroArgs> args);
|
||||
uint32_t macro_NbArgs();
|
||||
std::shared_ptr<std::string> macro_GetArg(uint32_t i);
|
||||
std::shared_ptr<std::string> macro_GetAllArgs();
|
||||
void macro_ShiftCurrentArgs(int32_t count);
|
||||
|
||||
#endif // RGBDS_MACRO_H
|
||||
|
||||
Reference in New Issue
Block a user