If that's what an industrial-strength compiler for a relatively niche language has to do, imagine what special cases LLVM and GCC have to deal with!
Thinking of the queen of languages relegated to "a relatively niche language" really made me sad.
They're just a global enum, almost all languages have enums.
You could say that it's a global (per package) weak hash table, from my understanding.