# compiler/renderer

Dark Mode

- Index

Search:
Group by:
Source Edit

# Imports

lexer, options, idents, ast, msgs, lineinfos

# Types

    TRenderFlag = enum
      renderNone, renderNoBody, renderNoComments, renderDocComments,
      renderNoPragmas, renderIds, renderNoProcDefs, renderSyms,
      renderRunnableExamples, renderIr

  Source Edit

    TRenderFlags = set[TRenderFlag]

  Source Edit

    TRenderTok = object
      kind*: TokType
      length*: int16
      sym*: PSym

  Source Edit

    TRenderTokSeq = seq[TRenderTok]

  Source Edit

    TSrcGen = object
      indent*: int
      lineLen*: int
      col: int
      pos*: int
      idx*: int
      tokens*: TRenderTokSeq
      buf*: string
      pendingNL*: int
      pendingWhitespace: int
      comStack*: seq[PNode]
      flags*: TRenderFlags
      inGenericParams: bool
      checkAnon: bool
      inPragma: int
      when defined(nimpretty):
          pendingNewlineCount: int

      fid*: FileIndex
      config*: ConfigRef
      mangler: seq[PSym]

  Source Edit

# Procs

    proc `$`(n: PNode): string {....raises: [Exception, KeyError], tags: [RootEffect].}

  Source Edit

    proc bracketKind(g: TSrcGen; n: PNode): BracketKind {....raises: [], tags: [].}

  Source Edit

    proc getNextTok(r: var TSrcGen; kind: var TokType; literal: var string) {.
        ...raises: [], tags: [].}

  Source Edit

    proc getTokSym(r: TSrcGen): PSym {....raises: [], tags: [].}

  Source Edit

    proc initTokRender(r: var TSrcGen; n: PNode; renderFlags: TRenderFlags = {}) {.
        ...raises: [Exception], tags: [RootEffect].}

  Source Edit

    proc isKeyword(i: PIdent): bool {....raises: [], tags: [].}

  Source Edit

    proc renderDefinitionName(s: PSym; noQuotes = false): string {....raises: [],
        tags: [].}

  Returns the definition name of the symbol.

  If noQuotes is false the symbol may be returned in backticks. This will happen if the name happens to be a keyword or the first character is not part of the SymStartChars set.

  Source Edit

    proc renderModule(n: PNode; outfile: string; renderFlags: TRenderFlags = {};
                      fid = FileIndex(-1); conf: ConfigRef = nil) {....raises: [
        Exception, KeyError, IOError, ValueError, OSError, ERecoverableError], tags: [
        RootEffect, WriteIOEffect, ReadDirEffect, ReadIOEffect, ReadEnvEffect].}

  Source Edit

    proc renderTree(n: PNode; renderFlags: TRenderFlags = {}): string {.
        ...raises: [Exception, KeyError], tags: [RootEffect].}

  Source Edit