Types
LayeredIdTableObj {.acyclic.} = object topLayer*: TypeMapping ## the mappings on the current layer nextLayer*: ref LayeredIdTableObj ## the parent type binding context, possibly `nil` previousLen*: int ## total length of the bindings up to the parent layer, ## used to track if new bindings were added
- stack of type binding contexts implemented as a linked list Source Edit
Procs
proc currentLen(pt: LayeredIdTable): int {....raises: [], tags: [], forbids: [].}
- the sum of the cached total binding count of the parents and the current binding count, just used to track if bindings were added Source Edit
proc initLayeredTypeMap(pt: sink TypeMapping = initTypeMapping()): LayeredIdTable {. ...raises: [], tags: [], forbids: [].}
- Source Edit
proc newTypeMapLayer(pt: LayeredIdTable): LayeredIdTable {....raises: [], tags: [], forbids: [].}
- Source Edit
proc setToPreviousLayer(pt: var LayeredIdTable) {.inline, ...raises: [], tags: [], forbids: [].}
- Source Edit
proc shallowCopy(pt: LayeredIdTable): LayeredIdTable {.inline, ...raises: [], tags: [], forbids: [].}
- copies only the type bindings of the current layer, but not any parent layers, useful for write-only bindings Source Edit