Allow negative values to count macro arguments from the end (#1670)

This commit is contained in:
Rangi
2025-04-20 00:37:50 -04:00
committed by GitHub
parent df83bc31d2
commit 0b7cda9e0c
7 changed files with 91 additions and 11 deletions

View File

@@ -9,11 +9,11 @@
#include <vector>
struct MacroArgs {
unsigned int shift;
uint32_t shift;
std::vector<std::shared_ptr<std::string>> args;
uint32_t nbArgs() const { return args.size() - shift; }
std::shared_ptr<std::string> getArg(uint32_t i) const;
std::shared_ptr<std::string> getArg(int32_t i) const;
std::shared_ptr<std::string> getAllArgs() const;
void appendArg(std::shared_ptr<std::string> arg);