Files
Nim/compiler/ast2nif.html
github-actions[bot] 3fda0740fb Deploy to GitHub pages
2026-06-23 10:35:16 +00:00

686 lines
74 KiB
HTML

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- This file is generated by Nim. -->
<html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en" data-theme="auto">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ast2nif</title>
<!-- Google fonts -->
<link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
<link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
<!-- Favicon -->
<link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAUAAAAF////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAIAAABbAAAAlQAAAKIAAACbAAAAmwAAAKIAAACVAAAAWwAAAAL///8A////AP///wD///8A////AAAAABQAAADAAAAAYwAAAA3///8A////AP///wD///8AAAAADQAAAGMAAADAAAAAFP///wD///8A////AP///wAAAACdAAAAOv///wD///8A////AP///wD///8A////AP///wD///8AAAAAOgAAAJ3///8A////AP///wAAAAAnAAAAcP///wAAAAAoAAAASv///wD///8A////AP///wAAAABKAAAAKP///wAAAABwAAAAJ////wD///8AAAAAgQAAABwAAACIAAAAkAAAAJMAAACtAAAAFQAAABUAAACtAAAAkwAAAJAAAACIAAAAHAAAAIH///8A////AAAAAKQAAACrAAAAaP///wD///8AAAAARQAAANIAAADSAAAARf///wD///8AAAAAaAAAAKsAAACk////AAAAADMAAACcAAAAnQAAABj///8A////AP///wAAAAAYAAAAGP///wD///8A////AAAAABgAAACdAAAAnAAAADMAAAB1AAAAwwAAAP8AAADpAAAAsQAAAE4AAAAb////AP///wAAAAAbAAAATgAAALEAAADpAAAA/wAAAMMAAAB1AAAAtwAAAOkAAAD/AAAA/wAAAP8AAADvAAAA3gAAAN4AAADeAAAA3gAAAO8AAAD/AAAA/wAAAP8AAADpAAAAtwAAAGUAAAA/AAAA3wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADfAAAAPwAAAGX///8A////AAAAAEgAAADtAAAAvwAAAL0AAADGAAAA7wAAAO8AAADGAAAAvQAAAL8AAADtAAAASP///wD///8A////AP///wD///8AAAAAO////wD///8A////AAAAAIcAAACH////AP///wD///8AAAAAO////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAP//AAD4HwAA7/cAAN/7AAD//wAAoYUAAJ55AACf+QAAh+EAAAAAAADAAwAA4AcAAP5/AAD//wAA//8AAA=="/>
<link rel="icon" type="image/png" sizes="32x32" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4QQQEwksSS9ZWwAAAk1JREFUWMPtll2ITVEUx39nn/O7Y5qR8f05wtCUUr6ZIS++8pEnkZInPImneaCQ5METNdOkeFBKUhMPRIkHKfEuUZSUlGlKPN2TrgfncpvmnntnmlEyq1Z7t89/rf9a6+y99oZxGZf/XeIq61EdtgKXgdXA0xrYAvBjOIF1AI9zvjcC74BSpndrJPkBWDScTF8Aa4E3wDlgHbASaANmVqlcCnwHvgDvgVfAJ+AikAAvgfVZwLnSVZHZaOuKoQi3ZOMi4NkYkpe1p4J7A8BpYAD49hfIy/oqG0+hLomiKP2L5L+1ubn5115S+3OAn4EnwBlgMzCjyt6ZAnQCJ4A7wOs88iRJHvw50HoujuPBoCKwHWiosy8MdfZnAdcHk8dxXFJ3VQbQlCTJvRBCGdRbD4M6uc5glpY3eAihpN5S5w12diSEcCCEcKUO4ljdr15T76ur1FDDLIQQ3qv71EdDOe3Kxj3leRXyk+pxdWnFWod6Wt2bY3de3aSuUHcPBVimHs7mK9WrmeOF6lR1o9qnzskh2ar2qm1qizpfXaPeVGdlmGN5pb09qMxz1Xb1kLqgzn1RyH7JUXW52lr5e/Kqi9qpto7V1atuUzfnARrV7jEib1T76gG2qxdGmXyiekkt1GswPTtek0aBfJp6YySGBfWg2tPQ0FAYgf1stUfdmdcjarbYJEniKIq6gY/Aw+zWHAC+p2labGpqiorFYgGYCEzN7oQdQClN07O1/EfDyGgC0ALMBdYAi4FyK+4H3gLPsxfR1zRNi+NP7nH5J+QntnXe5B5mpfQAAAAASUVORK5CYII=">
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="nimdoc.out.css?v=2.3.1">
<!-- JS -->
<script type="text/javascript" src="dochack.js?v=2.3.1"></script>
</head>
<body>
<div class="document" id="documentId">
<input type="checkbox" id="nav-toggle" hidden>
<label for="nav-toggle" id="nav-burger">&#9776;</label>
<label for="nav-toggle" id="nav-overlay"></label>
<div class="container">
<h1 class="title">ast2nif</h1>
<div class="row">
<div class="three columns">
<div class="theme-select-wrapper">
<label for="theme-select">Theme:&nbsp;</label>
<select id="theme-select" onchange="setTheme(this.value)">
<option value="auto">🌗 Match OS</option>
<option value="dark">🌑 Dark</option>
<option value="light">🌕 Light</option>
</select>
</div>
<div id="global-links">
<ul class="simple">
<li><a id="indexLink" href="theindex.html">Index</a></li>
</ul>
</div>
<div id="searchInputDiv">
Search: <input type="search" id="searchInput" oninput="search()"/>
</div>
<div>
Group by:
<select onchange="groupBy(this.value)">
<option value="section">Section</option>
<option value="type">Type</option>
</select>
</div>
<ul class="simple simple-toc" id="toc-list">
<li>
<a class="reference reference-toplevel" href="#6" id="56">Imports</a>
</li>
<li>
<details open>
<summary><a class="reference reference-toplevel" href="#7" id="57">Types</a></summary>
<ul class="simple simple-toc-section">
<li><a class="reference" href="#DecodeContext" title="DecodeContext = object">DecodeContext</a></li>
<li><a class="reference" href="#LoadFlag" title="LoadFlag = enum
LoadFullAst, AlwaysLoadInterface">LoadFlag</a></li>
<li><a class="reference" href="#ModuleSuffix" title="ModuleSuffix = distinct string">ModuleSuffix</a></li>
<li><a class="reference" href="#ParsedSymName" title="ParsedSymName = object
name*: string
module*: string
count*: int">ParsedSymName</a></li>
<li><a class="reference" href="#PrecompiledModule" title="PrecompiledModule = object
topLevel*: PNode
deps*: seq[ModuleSuffix]
logOps*: seq[LogEntry]
module*: PSym
reexportedModules*: seq[(string, string)]
genericOffers*: seq[tuple[generic, inst: PSym, concreteTypes: seq[PType],
genericParamsCount: int]] ## generic instances this module created; modulegraphs.nim rebuilds
## `procInstCache` from them so a consumer reuses the instance instead of
## re-instantiating it in its own (operator-blind) module scope.">PrecompiledModule</a></li>
</ul>
</details>
</li>
<li>
<details open>
<summary><a class="reference reference-toplevel" href="#10" id="60">Consts</a></summary>
<ul class="simple simple-toc-section">
<li><a class="reference" href="#SysModuleSuffix" title="SysModuleSuffix = &quot;@sys&quot;">SysModuleSuffix</a></li>
</ul>
</details>
</li>
<li>
<details open>
<summary><a class="reference reference-toplevel" href="#12" id="62">Procs</a></summary>
<ul class="simple simple-toc-section">
<ul class="simple nested-toc-section">createDecodeContext
<li><a class="reference" href="#createDecodeContext%2CConfigRef%2CIdentCache" title="createDecodeContext(config: ConfigRef; cache: IdentCache): DecodeContext">createDecodeContext(config: ConfigRef; cache: IdentCache): DecodeContext</a></li>
</ul>
<ul class="simple nested-toc-section">firstSon
<li><a class="reference" href="#firstSon%2CCursor" title="firstSon(n: Cursor): Cursor">firstSon(n: Cursor): Cursor</a></li>
</ul>
<ul class="simple nested-toc-section">getMainModuleSuffix
<li><a class="reference" href="#getMainModuleSuffix%2CDecodeContext" title="getMainModuleSuffix(c: DecodeContext): string">getMainModuleSuffix(c: DecodeContext): string</a></li>
</ul>
<ul class="simple nested-toc-section">globalName
<li><a class="reference" href="#globalName%2CPSym%2CConfigRef" title="globalName(sym: PSym; config: ConfigRef): string">globalName(sym: PSym; config: ConfigRef): string</a></li>
</ul>
<ul class="simple nested-toc-section">icNifTypeName
<li><a class="reference" href="#icNifTypeName%2CPType%2CConfigRef" title="icNifTypeName(typ: PType; config: ConfigRef): string">icNifTypeName(typ: PType; config: ConfigRef): string</a></li>
</ul>
<ul class="simple nested-toc-section">isStub
<li><a class="reference" href="#isStub%2CPSym" title="isStub(s: PSym): bool">isStub(s: PSym): bool</a></li>
<li><a class="reference" href="#isStub%2CPType" title="isStub(t: PType): bool">isStub(t: PType): bool</a></li>
</ul>
<ul class="simple nested-toc-section">loadNifModule
<li><a class="reference" href="#loadNifModule%2CDecodeContext%2CFileIndex%2CTStrTable%2CTStrTable%2Cset%5BLoadFlag%5D" title="loadNifModule(c: var DecodeContext; f: FileIndex;
interf, interfHidden: var TStrTable; flags: set[LoadFlag] = {}): PrecompiledModule">loadNifModule(c: var DecodeContext; f: FileIndex;
interf, interfHidden: var TStrTable; flags: set[LoadFlag] = {}): PrecompiledModule</a></li>
<li><a class="reference" href="#loadNifModule%2CDecodeContext%2CModuleSuffix%2CTStrTable%2CTStrTable%2Cset%5BLoadFlag%5D" title="loadNifModule(c: var DecodeContext; suffix: ModuleSuffix;
interf, interfHidden: var TStrTable; flags: set[LoadFlag] = {}): PrecompiledModule">loadNifModule(c: var DecodeContext; suffix: ModuleSuffix;
interf, interfHidden: var TStrTable; flags: set[LoadFlag] = {}): PrecompiledModule</a></li>
</ul>
<ul class="simple nested-toc-section">loadSym
<li><a class="reference" href="#loadSym%2CDecodeContext%2CPSym" title="loadSym(c: var DecodeContext; s: PSym)">loadSym(c: var DecodeContext; s: PSym)</a></li>
</ul>
<ul class="simple nested-toc-section">loadType
<li><a class="reference" href="#loadType%2CDecodeContext%2CPType" title="loadType(c: var DecodeContext; t: PType)">loadType(c: var DecodeContext; t: PType)</a></li>
</ul>
<ul class="simple nested-toc-section">moduleSymbolStubs
<li><a class="reference" href="#moduleSymbolStubs%2CDecodeContext%2CFileIndex" title="moduleSymbolStubs(c: var DecodeContext; module: FileIndex): seq[PSym]">moduleSymbolStubs(c: var DecodeContext; module: FileIndex): seq[PSym]</a></li>
</ul>
<ul class="simple nested-toc-section">parseSymName
<li><a class="reference" href="#parseSymName%2Cstring" title="parseSymName(s: string): ParsedSymName">parseSymName(s: string): ParsedSymName</a></li>
</ul>
<ul class="simple nested-toc-section">registerNifAstTags
<li><a class="reference" href="#registerNifAstTags" title="registerNifAstTags()">registerNifAstTags()</a></li>
</ul>
<ul class="simple nested-toc-section">resolveHookSym
<li><a class="reference" href="#resolveHookSym%2CDecodeContext%2C" title="resolveHookSym(c: var DecodeContext; symId: nifstreams.SymId): PSym">resolveHookSym(c: var DecodeContext; symId: nifstreams.SymId): PSym</a></li>
</ul>
<ul class="simple nested-toc-section">setMainModule
<li><a class="reference" href="#setMainModule%2CDecodeContext%2CFileIndex" title="setMainModule(c: var DecodeContext; fileIdx: FileIndex)">setMainModule(c: var DecodeContext; fileIdx: FileIndex)</a></li>
</ul>
<ul class="simple nested-toc-section">toClassSymId
<li><a class="reference" href="#toClassSymId%2CConfigRef%2CItemId" title="toClassSymId(config: ConfigRef; typeId: ItemId): nifstreams.SymId">toClassSymId(config: ConfigRef; typeId: ItemId): nifstreams.SymId</a></li>
</ul>
<ul class="simple nested-toc-section">toConverterIndexEntry
<li><a class="reference" href="#toConverterIndexEntry%2CConfigRef%2CPSym" title="toConverterIndexEntry(config: ConfigRef; converterSym: PSym): (nifstreams.SymId,
nifstreams.SymId)">toConverterIndexEntry(config: ConfigRef; converterSym: PSym): (nifstreams.SymId,
nifstreams.SymId)</a></li>
</ul>
<ul class="simple nested-toc-section">toHookIndexEntry
<li><a class="reference" href="#toHookIndexEntry%2CConfigRef%2CItemId%2CPSym" title="toHookIndexEntry(config: ConfigRef; typeId: ItemId; hookSym: PSym): HookIndexEntry">toHookIndexEntry(config: ConfigRef; typeId: ItemId; hookSym: PSym): HookIndexEntry</a></li>
</ul>
<ul class="simple nested-toc-section">toMethodIndexEntry
<li><a class="reference" href="#toMethodIndexEntry%2CConfigRef%2CPSym%2Cstring" title="toMethodIndexEntry(config: ConfigRef; methodSym: PSym; signature: string): (
nifstreams.SymId, nifstreams.StrId)">toMethodIndexEntry(config: ConfigRef; methodSym: PSym; signature: string): (
nifstreams.SymId, nifstreams.StrId)</a></li>
</ul>
<ul class="simple nested-toc-section">toNifFilename
<li><a class="reference" href="#toNifFilename%2CConfigRef%2CFileIndex" title="toNifFilename(conf: ConfigRef; f: FileIndex): string">toNifFilename(conf: ConfigRef; f: FileIndex): string</a></li>
</ul>
<ul class="simple nested-toc-section">tryResolveCompilerProc
<li><a class="reference" href="#tryResolveCompilerProc%2CDecodeContext%2Cstring%2CFileIndex" title="tryResolveCompilerProc(c: var DecodeContext; name: string;
moduleFileIdx: FileIndex): PSym">tryResolveCompilerProc(c: var DecodeContext; name: string;
moduleFileIdx: FileIndex): PSym</a></li>
</ul>
<ul class="simple nested-toc-section">writeNifModule
<li><a class="reference" href="#writeNifModule%2CConfigRef%2Cint32%2CPNode%2Cseq%5BLogEntry%5D%2Cseq%5BPNode%5D%2Cseq%5Bint%5D%2Cseq%5B%5D%2Cseq%5Btuple%5BPSym%2CPSym%2Cseq%5BPType%5D%2Cint%5D%5D%2Cseq%5BFileIndex%5D" title="writeNifModule(config: ConfigRef; thisModule: int32; n: PNode;
opsLog: seq[LogEntry]; replayActions: seq[PNode] = @[];
implDeps: seq[int] = @[];
reexportedModules: seq[(string, string)] = @[]; genericOffers: seq[tuple[
generic, inst: PSym, concreteTypes: seq[PType], genericParamsCount: int]] = @[];
resolvedImportDeps: seq[FileIndex] = @[])">writeNifModule(config: ConfigRef; thisModule: int32; n: PNode;
opsLog: seq[LogEntry]; replayActions: seq[PNode] = @[];
implDeps: seq[int] = @[];
reexportedModules: seq[(string, string)] = @[]; genericOffers: seq[tuple[
generic, inst: PSym, concreteTypes: seq[PType], genericParamsCount: int]] = @[];
resolvedImportDeps: seq[FileIndex] = @[])</a></li>
</ul>
<ul class="simple nested-toc-section">writeSemDeps
<li><a class="reference" href="#writeSemDeps%2CConfigRef%2Cint32%2Cseq%5Bstring%5D" title="writeSemDeps(config: ConfigRef; thisModule: int32; importPaths: seq[string])">writeSemDeps(config: ConfigRef; thisModule: int32; importPaths: seq[string])</a></li>
</ul>
</ul>
</details>
</li>
</ul>
</div>
<div class="nine columns" id="content">
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L1" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L1" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
<div id="tocRoot"></div>
<p class="module-desc">AST to NIF bridge.</p>
<div class="section" id="6">
<h1><a class="toc-backref" href="#6">Imports</a></h1>
<dl class="item">
<a class="reference external" href="astdef.html">astdef</a>, <a class="reference external" href="idents.html">idents</a>, <a class="reference external" href="msgs.html">msgs</a>, <a class="reference external" href="options.html">options</a>, <a class="reference external" href="lineinfos.html">lineinfos</a>, <a class="reference external" href="pathutils.html">pathutils</a>, <a class="reference external" href="typekeys.html">typekeys</a>, <a class="reference external" href="ic/enum2nif.html">ic/enum2nif</a>
</dl>
</div>
<div class="section" id="7">
<h1><a class="toc-backref" href="#7">Types</a></h1>
<dl class="item">
<div id="DecodeContext">
<dt><pre><a href="#DecodeContext"><span class="Identifier">DecodeContext</span></a> <span class="Other">=</span> <span class="Keyword">object</span></pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L1429" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L1429" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="LoadFlag">
<dt><pre><a href="#LoadFlag"><span class="Identifier">LoadFlag</span></a> <span class="Other">=</span> <span class="Keyword">enum</span>
<span class="Identifier">LoadFullAst</span><span class="Other">,</span> <span class="Identifier">AlwaysLoadInterface</span></pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L1470" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L1470" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="ModuleSuffix">
<dt><pre><a href="#ModuleSuffix"><span class="Identifier">ModuleSuffix</span></a> <span class="Other">=</span> <span class="Keyword">distinct</span> <span class="Identifier">string</span></pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L2258" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L2258" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="ParsedSymName">
<dt><pre><a href="#ParsedSymName"><span class="Identifier">ParsedSymName</span></a> <span class="Other">=</span> <span class="Keyword">object</span>
<span class="Identifier">name</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">string</span>
<span class="Identifier">module</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">string</span>
<span class="Identifier">count</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">int</span></pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L244" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L244" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="PrecompiledModule">
<dt><pre><a href="#PrecompiledModule"><span class="Identifier">PrecompiledModule</span></a> <span class="Other">=</span> <span class="Keyword">object</span>
<span class="Identifier">topLevel</span><span class="Operator">*</span><span class="Other">:</span> <a href="astdef.html#PNode"><span class="Identifier">PNode</span></a>
<span class="Identifier">deps</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><a href="#ModuleSuffix"><span class="Identifier">ModuleSuffix</span></a><span class="Other">]</span>
<span class="Identifier">logOps</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><a href="astdef.html#LogEntry"><span class="Identifier">LogEntry</span></a><span class="Other">]</span>
<span class="Identifier">module</span><span class="Operator">*</span><span class="Other">:</span> <a href="astdef.html#PSym"><span class="Identifier">PSym</span></a>
<span class="Identifier">reexportedModules</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><span class="Other">(</span><span class="Identifier">string</span><span class="Other">,</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">]</span>
<span class="Identifier">genericOffers</span><span class="Operator">*</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><span class="Keyword">tuple</span><span class="Other">[</span><span class="Identifier">generic</span><span class="Other">,</span> <span class="Identifier">inst</span><span class="Other">:</span> <a href="astdef.html#PSym"><span class="Identifier">PSym</span></a><span class="Other">,</span> <span class="Identifier">concreteTypes</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><a href="astdef.html#PType"><span class="Identifier">PType</span></a><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">genericParamsCount</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">]</span><span class="Other">]</span> <span class="Comment">## generic instances this module created; modulegraphs.nim rebuilds</span>
<span class="Comment">## `procInstCache` from them so a consumer reuses the instance instead of</span>
<span class="Comment">## re-instantiating it in its own (operator-blind) module scope.</span></pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L2259" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L2259" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</dl>
</div>
<div class="section" id="10">
<h1><a class="toc-backref" href="#10">Consts</a></h1>
<dl class="item">
<div id="SysModuleSuffix">
<dt><pre><a href="#SysModuleSuffix"><span class="Identifier">SysModuleSuffix</span></a> <span class="Other">=</span> <span class="StringLit">&quot;@sys&quot;</span></pre></dt>
<dd>
Reserved module-suffix sentinel for module-less magic singleton types — the <tt class="docutils literal"><span class="pre"><span class="Keyword">nil</span></span></tt> type is created via <tt class="docutils literal"><span class="pre"><span class="Identifier">newSysType</span></span></tt> with the graph idgen, whose <tt class="docutils literal"><span class="pre"><span class="Identifier">module</span></span></tt> can be <tt class="docutils literal"><span class="pre"><span class="Operator">-</span><span class="DecNumber">1</span></span></tt> (e.g. during VM const-eval before a real module is current), so its <tt class="docutils literal"><span class="pre"><span class="Identifier">uniqueId</span><span class="Operator">.</span><span class="Identifier">module</span></span></tt> is unresolvable. Such a type has no fields and an identity that is fully captured by its kind, so we serialize it with this sentinel and reconstruct it on load (see <tt class="docutils literal"><span class="pre"><span class="Identifier">createTypeStub</span></span></tt>) without ever touching a <tt class="docutils literal"><span class="pre"><span class="Operator">.</span><span class="Identifier">nif</span></span></tt> file. A real <tt class="docutils literal"><span class="pre"><span class="Identifier">moduleSuffix</span></span></tt> never starts with '@'.
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L28" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L28" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</dl>
</div>
<div class="section" id="12">
<h1><a class="toc-backref" href="#12">Procs</a></h1>
<dl class="item">
<div id="createDecodeContext-procs-all">
<div id="createDecodeContext,ConfigRef,IdentCache">
<dt><pre><span class="Keyword">proc</span> <a href="#createDecodeContext%2CConfigRef%2CIdentCache"><span class="Identifier">createDecodeContext</span></a><span class="Other">(</span><span class="Identifier">config</span><span class="Other">:</span> <a href="options.html#ConfigRef"><span class="Identifier">ConfigRef</span></a><span class="Other">;</span> <span class="Identifier">cache</span><span class="Other">:</span> <a href="idents.html#IdentCache"><span class="Identifier">IdentCache</span></a><span class="Other">)</span><span class="Other">:</span> <a href="#DecodeContext"><span class="Identifier">DecodeContext</span></a> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Supposed to be a global variable
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L1441" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L1441" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="firstSon-procs-all">
<div id="firstSon,Cursor">
<dt><pre><span class="Keyword">proc</span> <a href="#firstSon%2CCursor"><span class="Identifier">firstSon</span></a><span class="Other">(</span><span class="Identifier">n</span><span class="Other">:</span> <span class="Identifier">Cursor</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">Cursor</span> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L1393" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L1393" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="getMainModuleSuffix-procs-all">
<div id="getMainModuleSuffix,DecodeContext">
<dt><pre><span class="Keyword">proc</span> <a href="#getMainModuleSuffix%2CDecodeContext"><span class="Identifier">getMainModuleSuffix</span></a><span class="Other">(</span><span class="Identifier">c</span><span class="Other">:</span> <a href="#DecodeContext"><span class="Identifier">DecodeContext</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L1450" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L1450" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="globalName-procs-all">
<div id="globalName,PSym,ConfigRef">
<dt><pre><span class="Keyword">proc</span> <a href="#globalName%2CPSym%2CConfigRef"><span class="Identifier">globalName</span></a><span class="Other">(</span><span class="Identifier">sym</span><span class="Other">:</span> <a href="astdef.html#PSym"><span class="Identifier">PSym</span></a><span class="Other">;</span> <span class="Identifier">config</span><span class="Other">:</span> <a href="options.html#ConfigRef"><span class="Identifier">ConfigRef</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L233" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L233" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="icNifTypeName-procs-all">
<div id="icNifTypeName,PType,ConfigRef">
<dt><pre><span class="Keyword">proc</span> <a href="#icNifTypeName%2CPType%2CConfigRef"><span class="Identifier">icNifTypeName</span></a><span class="Other">(</span><span class="Identifier">typ</span><span class="Other">:</span> <a href="astdef.html#PType"><span class="Identifier">PType</span></a><span class="Other">;</span> <span class="Identifier">config</span><span class="Other">:</span> <a href="options.html#ConfigRef"><span class="Identifier">ConfigRef</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
The serialized NIF name of a type, recorded next to RTTI data definitions in the cnif artifact so a later run can re-demand the typeinfo when a reused TU still references it (the def-retention check). Backend-minted types have no NIF name.
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L51" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L51" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="isStub-procs-all">
<div id="isStub,PSym">
<dt><pre><span class="Keyword">proc</span> <a href="#isStub%2CPSym"><span class="Identifier">isStub</span></a><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <a href="astdef.html#PSym"><span class="Identifier">PSym</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L1719" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L1719" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="isStub,PType">
<dt><pre><span class="Keyword">proc</span> <a href="#isStub%2CPType"><span class="Identifier">isStub</span></a><span class="Other">(</span><span class="Identifier">t</span><span class="Other">:</span> <a href="astdef.html#PType"><span class="Identifier">PType</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L1718" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L1718" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="loadNifModule-procs-all">
<div id="loadNifModule,DecodeContext,FileIndex,TStrTable,TStrTable,set[LoadFlag]">
<dt><pre><span class="Keyword">proc</span> <a href="#loadNifModule%2CDecodeContext%2CFileIndex%2CTStrTable%2CTStrTable%2Cset%5BLoadFlag%5D"><span class="Identifier">loadNifModule</span></a><span class="Other">(</span><span class="Identifier">c</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="#DecodeContext"><span class="Identifier">DecodeContext</span></a><span class="Other">;</span> <span class="Identifier">f</span><span class="Other">:</span> <a href="lineinfos.html#FileIndex"><span class="Identifier">FileIndex</span></a><span class="Other">;</span>
<span class="Identifier">interf</span><span class="Other">,</span> <span class="Identifier">interfHidden</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="astdef.html#TStrTable"><span class="Identifier">TStrTable</span></a><span class="Other">;</span>
<span class="Identifier">flags</span><span class="Other">:</span> <span class="Identifier">set</span><span class="Other">[</span><a href="#LoadFlag"><span class="Identifier">LoadFlag</span></a><span class="Other">]</span> <span class="Other">=</span> <span class="Other">{</span><span class="Other">}</span><span class="Other">)</span><span class="Other">:</span> <a href="#PrecompiledModule"><span class="Identifier">PrecompiledModule</span></a> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">OSError</span><span class="Other">,</span> <span class="Identifier">ValueError</span><span class="Other">,</span> <span class="Identifier">KeyError</span><span class="Other">,</span> <span class="Identifier">Exception</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">,</span> <span class="Identifier">ReadEnvEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadDirEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L2489" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L2489" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
<div id="loadNifModule,DecodeContext,ModuleSuffix,TStrTable,TStrTable,set[LoadFlag]">
<dt><pre><span class="Keyword">proc</span> <a href="#loadNifModule%2CDecodeContext%2CModuleSuffix%2CTStrTable%2CTStrTable%2Cset%5BLoadFlag%5D"><span class="Identifier">loadNifModule</span></a><span class="Other">(</span><span class="Identifier">c</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="#DecodeContext"><span class="Identifier">DecodeContext</span></a><span class="Other">;</span> <span class="Identifier">suffix</span><span class="Other">:</span> <a href="#ModuleSuffix"><span class="Identifier">ModuleSuffix</span></a><span class="Other">;</span>
<span class="Identifier">interf</span><span class="Other">,</span> <span class="Identifier">interfHidden</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="astdef.html#TStrTable"><span class="Identifier">TStrTable</span></a><span class="Other">;</span>
<span class="Identifier">flags</span><span class="Other">:</span> <span class="Identifier">set</span><span class="Other">[</span><a href="#LoadFlag"><span class="Identifier">LoadFlag</span></a><span class="Other">]</span> <span class="Other">=</span> <span class="Other">{</span><span class="Other">}</span><span class="Other">)</span><span class="Other">:</span> <a href="#PrecompiledModule"><span class="Identifier">PrecompiledModule</span></a> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">OSError</span><span class="Other">,</span> <span class="Identifier">ValueError</span><span class="Other">,</span> <span class="Identifier">KeyError</span><span class="Other">,</span> <span class="Identifier">Exception</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadEnvEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadDirEffect</span><span class="Other">,</span> <span class="Identifier">RootEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L2465" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L2465" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="loadSym-procs-all">
<div id="loadSym,DecodeContext,PSym">
<dt><pre><span class="Keyword">proc</span> <a href="#loadSym%2CDecodeContext%2CPSym"><span class="Identifier">loadSym</span></a><span class="Other">(</span><span class="Identifier">c</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="#DecodeContext"><span class="Identifier">DecodeContext</span></a><span class="Other">;</span> <span class="Identifier">s</span><span class="Other">:</span> <a href="astdef.html#PSym"><span class="Identifier">PSym</span></a><span class="Other">)</span> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">KeyError</span><span class="Other">,</span> <span class="Identifier">ValueError</span><span class="Other">,</span> <span class="Identifier">Exception</span><span class="Other">,</span> <span class="Identifier">OSError</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">,</span> <span class="Identifier">ReadEnvEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadDirEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L1891" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L1891" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="loadType-procs-all">
<div id="loadType,DecodeContext,PType">
<dt><pre><span class="Keyword">proc</span> <a href="#loadType%2CDecodeContext%2CPType"><span class="Identifier">loadType</span></a><span class="Other">(</span><span class="Identifier">c</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="#DecodeContext"><span class="Identifier">DecodeContext</span></a><span class="Other">;</span> <span class="Identifier">t</span><span class="Other">:</span> <a href="astdef.html#PType"><span class="Identifier">PType</span></a><span class="Other">)</span> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">KeyError</span><span class="Other">,</span> <span class="Identifier">ValueError</span><span class="Other">,</span> <span class="Identifier">Exception</span><span class="Other">,</span> <span class="Identifier">OSError</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">,</span> <span class="Identifier">ReadEnvEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadDirEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L1799" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L1799" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="moduleSymbolStubs-procs-all">
<div id="moduleSymbolStubs,DecodeContext,FileIndex">
<dt><pre><span class="Keyword">proc</span> <a href="#moduleSymbolStubs%2CDecodeContext%2CFileIndex"><span class="Identifier">moduleSymbolStubs</span></a><span class="Other">(</span><span class="Identifier">c</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="#DecodeContext"><span class="Identifier">DecodeContext</span></a><span class="Other">;</span> <span class="Identifier">module</span><span class="Other">:</span> <a href="lineinfos.html#FileIndex"><span class="Identifier">FileIndex</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><a href="astdef.html#PSym"><span class="Identifier">PSym</span></a><span class="Other">]</span> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">KeyError</span><span class="Other">,</span> <span class="Identifier">OSError</span><span class="Other">,</span> <span class="Identifier">ValueError</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadEnvEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadDirEffect</span><span class="Other">,</span> <span class="Identifier">RootEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<p>Stubs for every non-type symbol serialized in <tt class="docutils literal"><span class="pre"><span class="Identifier">module</span></span></tt>'s NIF index. The per-module backend uses this to emit the routines a module OWNS: procs are serialized as <tt class="docutils literal"><span class="pre"><span class="Punctuation">(</span><span class="Identifier">sd</span> <span class="Operator">...</span><span class="Punctuation">)</span></span></tt> symbol-defs and loaded lazily, never as <tt class="docutils literal"><span class="pre"><span class="Identifier">nkProcDef</span></span></tt> statements in the top-level stmt list, so <tt class="docutils literal"><span class="pre"><span class="Identifier">genTopLevelStmt</span></span></tt> alone never reaches them — without this, a routine called only from other modules would be emitted by nobody once the demanding module merely prototypes it.</p>
<p>Returns lazy stubs: the index table is moved out while iterating (loading a symbol can register new modules and invalidate the iterator), so the caller forces full load (<tt class="docutils literal"><span class="pre"><span class="Operator">.</span><span class="Identifier">kind</span></span></tt>, <tt class="docutils literal"><span class="pre"><span class="Operator">.</span><span class="Identifier">ast</span></span></tt>) and filters AFTER this returns, with the index back in place.</p>
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L2123" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L2123" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="parseSymName-procs-all">
<div id="parseSymName,string">
<dt><pre><span class="Keyword">proc</span> <a href="#parseSymName%2Cstring"><span class="Identifier">parseSymName</span></a><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <a href="#ParsedSymName"><span class="Identifier">ParsedSymName</span></a> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L249" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L249" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="registerNifAstTags-procs-all">
<div id="registerNifAstTags">
<dt><pre><span class="Keyword">proc</span> <a href="#registerNifAstTags"><span class="Identifier">registerNifAstTags</span></a><span class="Other">(</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
(Re)registers ast2nif's NIF tags explicitly. The top-level <tt class="docutils literal"><span class="pre"><span class="Identifier">registerTag</span></span></tt> initializers above depend on <tt class="docutils literal"><span class="pre"><span class="Identifier">nifstreams</span><span class="Operator">.</span><span class="Identifier">pool</span></span></tt> having been initialized FIRST (<tt class="docutils literal"><span class="pre"><span class="Identifier">pool</span> <span class="Operator">=</span> <span class="Identifier">createLiterals</span><span class="Punctuation">(</span><span class="Identifier">TagData</span><span class="Punctuation">)</span></span></tt> in nifstreams' module init) — an inter-module init-order requirement. The IC-built compiler currently emits module init calls in a different order, so the initializers registered into a pool that was subsequently replaced: the tag ids then denoted builtin tags (<tt class="docutils literal"><span class="pre"><span class="Identifier">replay</span></span></tt> came out as <tt class="docutils literal"><span class="pre"><span class="Identifier">deref</span></span></tt>, <tt class="docutils literal"><span class="pre"><span class="Identifier">repdestroy</span></span></tt> as <tt class="docutils literal"><span class="pre"><span class="Identifier">pat</span></span></tt>, ...) and every written NIF was silently corrupted. Called from <tt class="docutils literal"><span class="pre"><span class="Identifier">nim</span><span class="Operator">.</span><span class="Identifier">nim</span></span></tt> before any command runs; idempotent (<tt class="docutils literal"><span class="pre"><span class="Identifier">getOrIncl</span></span></tt> by name).
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L613" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L613" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="resolveHookSym-procs-all">
<div id="resolveHookSym,DecodeContext,">
<dt><pre><span class="Keyword">proc</span> <a href="#resolveHookSym%2CDecodeContext%2C"><span class="Identifier">resolveHookSym</span></a><span class="Other">(</span><span class="Identifier">c</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="#DecodeContext"><span class="Identifier">DecodeContext</span></a><span class="Other">;</span> <span class="Identifier">symId</span><span class="Other">:</span> <span class="Identifier">nifstreams</span><span class="Other">.</span><span class="Identifier">SymId</span><span class="Other">)</span><span class="Other">:</span> <a href="astdef.html#PSym"><span class="Identifier">PSym</span></a> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">OSError</span><span class="Other">,</span> <span class="Identifier">ValueError</span><span class="Other">,</span> <span class="Identifier">KeyError</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">ReadEnvEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadDirEffect</span><span class="Other">,</span> <span class="Identifier">RootEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Resolves a hook SymId to PSym. Hook symbols are often private (generated =destroy, =wasMoved, etc.)
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L2179" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L2179" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="setMainModule-procs-all">
<div id="setMainModule,DecodeContext,FileIndex">
<dt><pre><span class="Keyword">proc</span> <a href="#setMainModule%2CDecodeContext%2CFileIndex"><span class="Identifier">setMainModule</span></a><span class="Other">(</span><span class="Identifier">c</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="#DecodeContext"><span class="Identifier">DecodeContext</span></a><span class="Other">;</span> <span class="Identifier">fileIdx</span><span class="Other">:</span> <a href="lineinfos.html#FileIndex"><span class="Identifier">FileIndex</span></a><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Records the module that is being compiled fresh so that re-exports of its own symbols by dependencies are not turned into duplicate stubs.
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L1445" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L1445" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="toClassSymId-procs-all">
<div id="toClassSymId,ConfigRef,ItemId">
<dt><pre><span class="Keyword">proc</span> <a href="#toClassSymId%2CConfigRef%2CItemId"><span class="Identifier">toClassSymId</span></a><span class="Other">(</span><span class="Identifier">config</span><span class="Other">:</span> <a href="options.html#ConfigRef"><span class="Identifier">ConfigRef</span></a><span class="Other">;</span> <span class="Identifier">typeId</span><span class="Other">:</span> <a href="itemids.html#ItemId"><span class="Identifier">ItemId</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">nifstreams</span><span class="Other">.</span><span class="Identifier">SymId</span> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Converts a type ItemId to its SymId for the class index.
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L95" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L95" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="toConverterIndexEntry-procs-all">
<div id="toConverterIndexEntry,ConfigRef,PSym">
<dt><pre><span class="Keyword">proc</span> <a href="#toConverterIndexEntry%2CConfigRef%2CPSym"><span class="Identifier">toConverterIndexEntry</span></a><span class="Other">(</span><span class="Identifier">config</span><span class="Other">:</span> <a href="options.html#ConfigRef"><span class="Identifier">ConfigRef</span></a><span class="Other">;</span> <span class="Identifier">converterSym</span><span class="Other">:</span> <a href="astdef.html#PSym"><span class="Identifier">PSym</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Other">(</span>
<span class="Identifier">nifstreams</span><span class="Other">.</span><span class="Identifier">SymId</span><span class="Other">,</span> <span class="Identifier">nifstreams</span><span class="Other">.</span><span class="Identifier">SymId</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Converts a converter symbol to an index entry (destType, converterSym). Returns the destination type's SymId and the converter's SymId.
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L72" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L72" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="toHookIndexEntry-procs-all">
<div id="toHookIndexEntry,ConfigRef,ItemId,PSym">
<dt><pre><span class="Keyword">proc</span> <a href="#toHookIndexEntry%2CConfigRef%2CItemId%2CPSym"><span class="Identifier">toHookIndexEntry</span></a><span class="Other">(</span><span class="Identifier">config</span><span class="Other">:</span> <a href="options.html#ConfigRef"><span class="Identifier">ConfigRef</span></a><span class="Other">;</span> <span class="Identifier">typeId</span><span class="Other">:</span> <a href="itemids.html#ItemId"><span class="Identifier">ItemId</span></a><span class="Other">;</span> <span class="Identifier">hookSym</span><span class="Other">:</span> <a href="astdef.html#PSym"><span class="Identifier">PSym</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">HookIndexEntry</span> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Converts a type ItemId and hook symbol to a HookIndexEntry for the NIF index.
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L61" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L61" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="toMethodIndexEntry-procs-all">
<div id="toMethodIndexEntry,ConfigRef,PSym,string">
<dt><pre><span class="Keyword">proc</span> <a href="#toMethodIndexEntry%2CConfigRef%2CPSym%2Cstring"><span class="Identifier">toMethodIndexEntry</span></a><span class="Other">(</span><span class="Identifier">config</span><span class="Other">:</span> <a href="options.html#ConfigRef"><span class="Identifier">ConfigRef</span></a><span class="Other">;</span> <span class="Identifier">methodSym</span><span class="Other">:</span> <a href="astdef.html#PSym"><span class="Identifier">PSym</span></a><span class="Other">;</span> <span class="Identifier">signature</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">:</span> <span class="Other">(</span>
<span class="Identifier">nifstreams</span><span class="Other">.</span><span class="Identifier">SymId</span><span class="Other">,</span> <span class="Identifier">nifstreams</span><span class="Other">.</span><span class="Identifier">StrId</span><span class="Other">)</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Converts a method symbol/signature to a method index entry.
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L87" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L87" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="toNifFilename-procs-all">
<div id="toNifFilename,ConfigRef,FileIndex">
<dt><pre><span class="Keyword">proc</span> <a href="#toNifFilename%2CConfigRef%2CFileIndex"><span class="Identifier">toNifFilename</span></a><span class="Other">(</span><span class="Identifier">conf</span><span class="Other">:</span> <a href="options.html#ConfigRef"><span class="Identifier">ConfigRef</span></a><span class="Other">;</span> <span class="Identifier">f</span><span class="Other">:</span> <a href="lineinfos.html#FileIndex"><span class="Identifier">FileIndex</span></a><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">string</span> {.<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">OSError</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">,</span> <span class="Identifier">ReadEnvEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L2146" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L2146" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="tryResolveCompilerProc-procs-all">
<div id="tryResolveCompilerProc,DecodeContext,string,FileIndex">
<dt><pre><span class="Keyword">proc</span> <a href="#tryResolveCompilerProc%2CDecodeContext%2Cstring%2CFileIndex"><span class="Identifier">tryResolveCompilerProc</span></a><span class="Other">(</span><span class="Identifier">c</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="#DecodeContext"><span class="Identifier">DecodeContext</span></a><span class="Other">;</span> <span class="Identifier">name</span><span class="Other">:</span> <span class="Identifier">string</span><span class="Other">;</span>
<span class="Identifier">moduleFileIdx</span><span class="Other">:</span> <a href="lineinfos.html#FileIndex"><span class="Identifier">FileIndex</span></a><span class="Other">)</span><span class="Other">:</span> <a href="astdef.html#PSym"><span class="Identifier">PSym</span></a> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">OSError</span><span class="Other">,</span> <span class="Identifier">ValueError</span><span class="Other">,</span> <span class="Identifier">KeyError</span><span class="Other">,</span> <span class="Identifier">Exception</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">,</span> <span class="Identifier">ReadEnvEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">ReadDirEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
Tries to resolve a compiler proc from a module by checking the NIF index. Returns nil if the symbol doesn't exist. The NIF disamb is mint order, so <tt class="docutils literal"><span class="pre"><span class="Identifier">name</span><span class="Operator">.</span><span class="FloatNumber">0.</span></span></tt> can be any of the overloads sharing the name — for <tt class="docutils literal"><span class="pre"><span class="Identifier">newSeq</span></span></tt> it is the generic magic, not the RTL proc (a refc build then demands codegen of the generic and dies on <tt class="docutils literal"><span class="pre"><span class="Identifier">seq</span><span class="Punctuation">[</span><span class="Identifier">T</span><span class="Punctuation">]</span></span></tt>): enumerate the index entries with this basename and pick the one that carries <tt class="docutils literal"><span class="pre"><span class="Identifier">sfCompilerProc</span></span></tt>.
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L2185" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L2185" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="writeNifModule-procs-all">
<div id="writeNifModule,ConfigRef,int32,PNode,seq[LogEntry],seq[PNode],seq[int],seq[],seq[tuple[PSym,PSym,seq[PType],int]],seq[FileIndex]">
<dt><pre><span class="Keyword">proc</span> <a href="#writeNifModule%2CConfigRef%2Cint32%2CPNode%2Cseq%5BLogEntry%5D%2Cseq%5BPNode%5D%2Cseq%5Bint%5D%2Cseq%5B%5D%2Cseq%5Btuple%5BPSym%2CPSym%2Cseq%5BPType%5D%2Cint%5D%5D%2Cseq%5BFileIndex%5D"><span class="Identifier">writeNifModule</span></a><span class="Other">(</span><span class="Identifier">config</span><span class="Other">:</span> <a href="options.html#ConfigRef"><span class="Identifier">ConfigRef</span></a><span class="Other">;</span> <span class="Identifier">thisModule</span><span class="Other">:</span> <span class="Identifier">int32</span><span class="Other">;</span> <span class="Identifier">n</span><span class="Other">:</span> <a href="astdef.html#PNode"><span class="Identifier">PNode</span></a><span class="Other">;</span>
<span class="Identifier">opsLog</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><a href="astdef.html#LogEntry"><span class="Identifier">LogEntry</span></a><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">replayActions</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><a href="astdef.html#PNode"><span class="Identifier">PNode</span></a><span class="Other">]</span> <span class="Other">=</span> <span class="Operator">@</span><span class="Other">[</span><span class="Other">]</span><span class="Other">;</span>
<span class="Identifier">implDeps</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><span class="Identifier">int</span><span class="Other">]</span> <span class="Other">=</span> <span class="Operator">@</span><span class="Other">[</span><span class="Other">]</span><span class="Other">;</span>
<span class="Identifier">reexportedModules</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><span class="Other">(</span><span class="Identifier">string</span><span class="Other">,</span> <span class="Identifier">string</span><span class="Other">)</span><span class="Other">]</span> <span class="Other">=</span> <span class="Operator">@</span><span class="Other">[</span><span class="Other">]</span><span class="Other">;</span>
<span class="Identifier">genericOffers</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><span class="Keyword">tuple</span><span class="Other">[</span><span class="Identifier">generic</span><span class="Other">,</span> <span class="Identifier">inst</span><span class="Other">:</span> <a href="astdef.html#PSym"><span class="Identifier">PSym</span></a><span class="Other">,</span> <span class="Identifier">concreteTypes</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><a href="astdef.html#PType"><span class="Identifier">PType</span></a><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">genericParamsCount</span><span class="Other">:</span> <span class="Identifier">int</span><span class="Other">]</span><span class="Other">]</span> <span class="Other">=</span> <span class="Operator">@</span><span class="Other">[</span><span class="Other">]</span><span class="Other">;</span>
<span class="Identifier">resolvedImportDeps</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><a href="lineinfos.html#FileIndex"><span class="Identifier">FileIndex</span></a><span class="Other">]</span> <span class="Other">=</span> <span class="Operator">@</span><span class="Other">[</span><span class="Other">]</span><span class="Other">)</span> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">KeyError</span><span class="Other">,</span> <span class="Identifier">Exception</span><span class="Other">,</span> <span class="Identifier">OSError</span><span class="Other">,</span> <span class="Identifier">IOError</span><span class="Other">,</span> <span class="Identifier">ValueError</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span>
<span class="Identifier">RootEffect</span><span class="Other">,</span> <span class="Identifier">ReadEnvEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">,</span> <span class="Identifier">WriteDirEffect</span><span class="Other">,</span> <span class="Identifier">ReadDirEffect</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L1251" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L1251" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
<div id="writeSemDeps-procs-all">
<div id="writeSemDeps,ConfigRef,int32,seq[string]">
<dt><pre><span class="Keyword">proc</span> <a href="#writeSemDeps%2CConfigRef%2Cint32%2Cseq%5Bstring%5D"><span class="Identifier">writeSemDeps</span></a><span class="Other">(</span><span class="Identifier">config</span><span class="Other">:</span> <a href="options.html#ConfigRef"><span class="Identifier">ConfigRef</span></a><span class="Other">;</span> <span class="Identifier">thisModule</span><span class="Other">:</span> <span class="Identifier">int32</span><span class="Other">;</span> <span class="Identifier">importPaths</span><span class="Other">:</span> <span class="Identifier">seq</span><span class="Other">[</span><span class="Identifier">string</span><span class="Other">]</span><span class="Other">)</span> {.
<span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">OSError</span><span class="Other">,</span> <span class="Identifier">Exception</span><span class="Other">]</span><span class="Other">,</span>
<span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">RootEffect</span><span class="Other">,</span> <span class="Identifier">ReadEnvEffect</span><span class="Other">,</span> <span class="Identifier">ReadIOEffect</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">forbids</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span>.}</pre></dt>
<dd>
The module's REAL direct imports as <tt class="docutils literal"><span class="pre"><span class="Identifier">nim</span> <span class="Identifier">m</span></span></tt> sem resolved them — static plus any a macro generated — recorded as full source paths. <tt class="docutils literal"><span class="pre"><span class="Identifier">nim</span> <span class="Identifier">ic</span></span></tt> reads this <tt class="docutils literal"><span class="pre"><span class="Operator">.</span><span class="Identifier">s</span><span class="Operator">.</span><span class="Identifier">deps</span><span class="Operator">.</span><span class="Identifier">nif</span></span></tt> to re-derive the build graph: imports the static scanner missed become new nodes (replacing the old build-failure discovery loop), and <tt class="docutils literal"><span class="pre"><span class="Keyword">when</span> <span class="Identifier">false</span></span></tt> imports the scanner over-included are pruned. Always written so it is current after every successful sem (like <tt class="docutils literal"><span class="pre"><span class="Operator">.</span><span class="Identifier">edges</span></span></tt>).
<a href="https://github.com/nim-lang/Nim/tree/devel/compiler/ast2nif.nim#L1233" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
<a href="https://github.com/nim-lang/Nim/edit/devel/compiler/ast2nif.nim#L1233" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
</dd>
</div>
</div>
</dl>
</div>
</div>
</div>
<div class="twelve-columns footer">
<span class="nim-sprite"></span>
<br>
<small style="color: var(--hint);">Made with Nim. Generated: 2026-06-23 10:35:07 UTC</small>
</div>
</div>
</div>
<script defer data-domain="nim-lang.org" src="https://plausible.io/js/plausible.js"></script>
</body>
</html>