# renderer

Theme:

- Index

Search:
Group by:
Source Edit

# Imports

lexer, options, idents, ast, msgs, lineinfos, wordrecg

# Types

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

  Source Edit

    TRenderFlags = set[TRenderFlag]

  Source Edit

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

  Source Edit

    TRenderTokSeq = seq[TRenderTok]

  Source Edit

    TSrcGen = object
      indent*: int
      lineLen*: int
      pos*: int
      idx*: int
      tokens*: TRenderTokSeq
      buf*: string
      pendingNL*: int
      comStack*: seq[PNode]
      flags*: TRenderFlags
      when defined(nimpretty):
      fid*: FileIndex
      config*: ConfigRef

  Source Edit

# Procs

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

  Source Edit

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

  Source Edit

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

  Source Edit

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

  Source Edit

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

  Source Edit

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

  Source Edit

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

  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],
        forbids: [].}

  Source Edit

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

  Source Edit