From fc93c8ebda98b9f9e1711d321c8719dc50a79a54 Mon Sep 17 00:00:00 2001 From: "Tristan B. Velloza Kildaire" Date: Sun, 7 Apr 2024 13:43:22 +0200 Subject: [PATCH] Mappers - Documented --- source/tlang/compiler/codegen/mapper/impls.d | 28 ++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/source/tlang/compiler/codegen/mapper/impls.d b/source/tlang/compiler/codegen/mapper/impls.d index b60d6db..9cdf228 100644 --- a/source/tlang/compiler/codegen/mapper/impls.d +++ b/source/tlang/compiler/codegen/mapper/impls.d @@ -17,6 +17,9 @@ import std.string : format; */ public class LebanonMapper : SymbolMapper { + /** + * For access to the resolver + */ private TypeChecker tc; /** @@ -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; @@ -106,6 +120,9 @@ unittest */ public class HashMapper : SymbolMapper { + /** + * For access to the resolver + */ private TypeChecker tc; /** @@ -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;