Refactor FileStackNode::dump to not need a helper function

This commit is contained in:
Rangi42
2024-03-10 13:21:28 -04:00
parent 58fdaa8747
commit 846a9411b9
5 changed files with 54 additions and 53 deletions

View File

@@ -29,10 +29,10 @@ void sym_AddSymbol(Symbol &symbol) {
// Check if the symbol already exists
if (Symbol *other = sym_GetSymbol(symbol.name); other) {
fprintf(stderr, "error: \"%s\" both in %s from ", symbol.name.c_str(), symbol.objFileName);
symbol.src->dumpFileStack();
fprintf(stderr, "(%" PRIu32 ") and in %s from ", symbol.lineNo, other->objFileName);
other->src->dumpFileStack();
fprintf(stderr, "(%" PRIu32 ")\n", other->lineNo);
symbol.src->dump(symbol.lineNo);
fprintf(stderr, " and in %s from ", other->objFileName);
other->src->dump(other->lineNo);
fputc('\n', stderr);
exit(1);
}