compiler/sem/evaltempl

  Source   Edit

Template evaluation engine. Now hygienic.

Procs

proc evalTemplate(n: PNode; tmpl, genSymOwner: PSym; conf: ConfigRef;
                  ic: IdentCache; instID: ref int; idgen: IdGenerator;
                  fromHlo = false): PNode {.
    ...raises: [Exception, ERecoverableError, KeyError], tags: [RootEffect].}
  Source   Edit
proc evalTemplateArgs(n: PNode; s: PSym; conf: ConfigRef; fromHlo: bool): PNode {.
    ...raises: [Exception, ERecoverableError, KeyError], tags: [RootEffect].}

Produces an nkArgList node storing all arguments taken from the call-like expression n. Immediate templates/macros are also considered, by making sure enough parameters are provided and by inserting the default for parameters where no argument is provided.

Despite the name, the procedure also applies to macro arguments.

  Source   Edit
proc wrapInComesFrom(info: TLineInfo; sym: PSym; res: PNode): PNode {.
    ...raises: [], tags: [].}
  Source   Edit