HashMapper

- Added support for `ScopeType.LOCAL` in a similar fashion to how it is done in `LebanonMapper`
This commit is contained in:
Tristan B. Velloza Kildaire 2024-02-26 09:41:39 +02:00
parent 0be3376fc2
commit 4479df0501
1 changed files with 11 additions and 3 deletions

View File

@ -65,9 +65,17 @@ public class HashMapper : SymbolMapperV2
}
else
{
// TODO: Implement me
// TODO: May need to take in a `Container` (for top-level)
// path = tc.getResolver().generateName()
// Determine the module this entity is contained within
Module modCon = cast(Module)this.tc.getResolver().findContainerOfType(Module.classinfo, item);
// Generate absolute path (but without the `<moduleName>.[..]`)
// rather only everything after the first dot
string p = tc.getResolver().generateName(modCon, item);
import std.string : split, join;
string[] components = split(p, ".")[1..$];
// Join them back up with periods
path = join(components, ".");
}
// Generate the name as `_<hex(<path>)>`