nfl/backend

Search:
Group by:

Code generation: turns fully expanded and lowered Syntax forms into Nim NimNode AST via std/macros, the final step before the compiler macros in compiler.nim splice the result into the caller's module. Runs after lower.nim.

Procs

proc emitExpr(sx: Syntax): NimNode {....raises: [CompilerError, KeyError, Exception],
                                     tags: [ReadDirEffect, RootEffect],
                                     forbids: [].}
Emits a single lowered expression as a Nim expression NimNode, in a fresh emit context (its own hygienic-symbol table).
proc emitModule(forms: seq[Syntax]): NimNode {.
    ...raises: [CompilerError, Exception, KeyError],
    tags: [ReadDirEffect, RootEffect], forbids: [].}
Emits a whole module's lowered top-level forms as a single Nim NimNode statement list, sharing one emit context (and therefore one hygienic-symbol table) across all of them.
proc emitStmt(sx: Syntax): NimNode {....raises: [CompilerError, Exception, KeyError],
                                     tags: [ReadDirEffect, RootEffect],
                                     forbids: [].}
Emits a single lowered form as a Nim statement NimNode.