Refactor warnings and errors (#1728)

* Remove `err` and `warn`, keep `errx` and `warnx`, using them in RGBGFX too

* Separate RGBGFX and RGBLINK warnings/errors from main options

* Separate `report` function into `error` and `fatal` messages

* Implicit newlines for most RGBASM errors
This commit is contained in:
Rangi
2025-07-08 12:58:23 -04:00
committed by GitHub
parent 991b74dd0d
commit 35962dedc4
39 changed files with 753 additions and 757 deletions

View File

@@ -52,7 +52,7 @@ std::shared_ptr<std::string> MacroArgs::getAllArgs() const {
void MacroArgs::appendArg(std::shared_ptr<std::string> arg) {
if (arg->empty()) {
warning(WARNING_EMPTY_MACRO_ARG, "Empty macro argument\n");
warning(WARNING_EMPTY_MACRO_ARG, "Empty macro argument");
}
args.push_back(arg);
}
@@ -60,10 +60,10 @@ void MacroArgs::appendArg(std::shared_ptr<std::string> arg) {
void MacroArgs::shiftArgs(int32_t count) {
if (size_t nbArgs = args.size();
count > 0 && (static_cast<uint32_t>(count) > nbArgs || shift > nbArgs - count)) {
warning(WARNING_MACRO_SHIFT, "Cannot shift macro arguments past their end\n");
warning(WARNING_MACRO_SHIFT, "Cannot shift macro arguments past their end");
shift = nbArgs;
} else if (count < 0 && shift < static_cast<uint32_t>(-count)) {
warning(WARNING_MACRO_SHIFT, "Cannot shift macro arguments past their beginning\n");
warning(WARNING_MACRO_SHIFT, "Cannot shift macro arguments past their beginning");
shift = 0;
} else {
shift += count;