Renders Defs with their plain Def::sym instead of Def::unique_name while alive. More...
#include <mim/driver.h>
Public Member Functions | |
| PlainNames (const Driver *driver) | |
Activates plain naming on driver until this guard dies; a null driver leaves it off. | |
| ~PlainNames () | |
| bool | clashed () const |
Static Public Member Functions | |
| static bool | claim (const Driver &, Sym sym, uint32_t gid) |
Registers that gid renders as sym and reports whether the plain sym may be used. | |
Renders Defs with their plain Def::sym instead of Def::unique_name while alive.
A gid is noise in a diagnostic about the user's source - but it is also the only thing that tells two same-named Defs apart, so PlainNames::clashed reports when a message has to be rendered again with gids. The state lives in Driver::names, so two Drivers formatting at once never share it.
|
explicit |
Activates plain naming on driver until this guard dies; a null driver leaves it off.
Definition at line 191 of file driver.cpp.
Referenced by mim::Diag::render().
| mim::PlainNames::~PlainNames | ( | ) |
Definition at line 202 of file driver.cpp.
|
static |
Registers that gid renders as sym and reports whether the plain sym may be used.
Sets the clash flag - but still answers true - if another gid already claimed sym.
Definition at line 208 of file driver.cpp.
References mim::Driver::Names::clashed, and mim::Driver::names().
| bool mim::PlainNames::clashed | ( | ) | const |
Definition at line 206 of file driver.cpp.