mirror of
https://github.com/gbdev/rgbds.git
synced 2026-08-22 23:04:29 +00:00
Consistently handle negative shifted macro args (#2014)
Negative macro arguments count from the end, i.e. `\<-1>` is equivalent to `\<_NARG>`, even after `shift`ing them. Negative arguments cannot be used to access shifted values.
This commit is contained in:
@@ -13,7 +13,7 @@ struct MacroArgs {
|
||||
std::vector<std::shared_ptr<std::string>> args;
|
||||
|
||||
uint32_t nbArgs() const { return args.size() - shift; }
|
||||
std::shared_ptr<std::string> getArg(int32_t i) const;
|
||||
std::shared_ptr<std::string> getArg(int32_t num) const;
|
||||
std::shared_ptr<std::string> getAllArgs() const;
|
||||
|
||||
void appendArg(std::shared_ptr<std::string> arg);
|
||||
|
||||
Reference in New Issue
Block a user