Skip to content

Commit

Permalink
Mappers
Browse files Browse the repository at this point in the history
- Documented
  • Loading branch information
deavmi committed Apr 7, 2024
1 parent e4b9b5a commit fc93c8e
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions source/tlang/compiler/codegen/mapper/impls.d
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ import std.string : format;
*/
public class LebanonMapper : SymbolMapper
{
/**
* For access to the resolver
*/
private TypeChecker tc;

/**
Expand All @@ -32,6 +35,17 @@ public class LebanonMapper : SymbolMapper
this.tc = tc;
}

/**
* Maps the given `Entity` to a symbol
* name with the provided scope type
*
* Params:
* item = the entity to generate a
* symbol name for
* type = the `ScopeType` to map
* using
* Returns: the symbol name
*/
public string map(Entity item, ScopeType type)
{
string path;
Expand Down Expand Up @@ -106,6 +120,9 @@ unittest
*/
public class HashMapper : SymbolMapper
{
/**
* For access to the resolver
*/
private TypeChecker tc;

/**
Expand All @@ -121,6 +138,17 @@ public class HashMapper : SymbolMapper
this.tc = tc;
}

/**
* Maps the given `Entity` to a symbol
* name with the provided scope type
*
* Params:
* item = the entity to generate a
* symbol name for
* type = the `ScopeType` to map
* using
* Returns: the symbol name
*/
public string map(Entity item, ScopeType type)
{
string path;
Expand Down

0 comments on commit fc93c8e

Please sign in to comment.