Use colored/styled text output for diagnostics and usage info (#1775)

This commit is contained in:
Rangi
2025-08-04 17:02:24 -04:00
committed by GitHub
parent d992b21141
commit 23ce888d65
27 changed files with 656 additions and 197 deletions

View File

@@ -18,6 +18,7 @@
#include <unordered_map>
#include "helpers.hpp"
#include "style.hpp"
#include "util.hpp"
#include "verbosity.hpp"
@@ -845,9 +846,15 @@ void lexer_DumpStringExpansions() {
for (Expansion &exp : lexerState->expansions) {
// Only register EQUS expansions, not string args
if (exp.name) {
fprintf(stderr, "while expanding symbol \"%s\"\n", exp.name->c_str());
style_Set(stderr, STYLE_CYAN, false);
fputs("while expanding symbol \"", stderr);
style_Set(stderr, STYLE_CYAN, true);
fputs(exp.name->c_str(), stderr);
style_Set(stderr, STYLE_CYAN, false);
fputs("\"\n", stderr);
}
}
style_Reset(stderr);
}
// Functions to discard non-tokenized characters