# semdata

Dark Mode

- Index

Search:
Group by:

This module contains the data structures for the semantic checking phase.

# Imports

options, ast, astalgo, msgs, idents, renderer, magicsys, vmdef, modulegraphs, lineinfos

# Types

    TOptionEntry = object
      options*: TOptions
      defaultCC*: TCallingConvention
      dynlib*: PLib
      notes*: TNoteKinds
      features*: set[Feature]
      otherPragmas*: PNode
      warningAsErrors*: TNoteKinds

  Source Edit

    POptionEntry = ref TOptionEntry

  Source Edit

    PProcCon = ref TProcCon

  Source Edit

    TProcCon = object
      owner*: PSym
      resultSym*: PSym
      selfSym*: PSym
      nestedLoopCounter*: int
      nestedBlockCounter*: int
      inTryStmt*: int
      next*: PProcCon
      mappingExists*: bool
      mapping*: TIdTable
      caseContext*: seq[tuple[n: PNode, idx: int]]
      localBindStmts*: seq[PNode]

  Source Edit

    TMatchedConcept = object
      candidateType*: PType
      prev*: ptr TMatchedConcept
      depth*: int

  Source Edit

    TInstantiationPair = object
      genericSym*: PSym
      inst*: PInstantiation

  Source Edit

    TExprFlag = enum
      efLValue, efWantIterator, efInTypeof, efNeedStatic, efPreferStatic,
      efPreferNilResult, efWantStmt, efAllowStmt, efDetermineType, efExplain,
      efAllowDestructor, efWantValue, efOperand, efNoSemCheck, efNoEvaluateGeneric,
      efInCall, efFromHlo, efNoSem2Check, efNoUndeclared

  Source Edit

    TExprFlags = set[TExprFlag]

  Source Edit

    PContext = ref TContext

  Source Edit

    TContext = object of TPassContext
      enforceVoidContext*: PType
      module*: PSym
      currentScope*: PScope
      importTable*: PScope
      topLevelScope*: PScope
      p*: PProcCon
      matchedConcept*: ptr TMatchedConcept
      friendModules*: seq[PSym]
      instCounter*: int
      templInstCounter*: ref int
      ambiguousSymbols*: IntSet
      inGenericContext*: int
      inStaticContext*: int
      inUnrolledContext*: int
      compilesContextId*: int
      compilesContextIdGenerator*: int
      inGenericInst*: int
      converters*: seq[PSym]
      patterns*: seq[PSym]
      optionStack*: seq[POptionEntry]
      symMapping*: TIdTable
      libs*: seq[PLib]
      semConstExpr*: proc (c: PContext; n: PNode): PNode {...}{.nimcall.}
      semExpr*: proc (c: PContext; n: PNode; flags: TExprFlags = {}): PNode {...}{.
          nimcall.}
      semTryExpr*: proc (c: PContext; n: PNode; flags: TExprFlags = {}): PNode {...}{.
          nimcall.}
      semTryConstExpr*: proc (c: PContext; n: PNode): PNode {...}{.nimcall.}
      computeRequiresInit*: proc (c: PContext; t: PType): bool {...}{.nimcall.}
      hasUnresolvedArgs*: proc (c: PContext; n: PNode): bool
      semOperand*: proc (c: PContext; n: PNode; flags: TExprFlags = {}): PNode {...}{.
          nimcall.}
      semConstBoolExpr*: proc (c: PContext; n: PNode): PNode {...}{.nimcall.}
      semOverloadedCall*: proc (c: PContext; n, nOrig: PNode; filter: TSymKinds;
                                flags: TExprFlags): PNode {...}{.nimcall.}
      semTypeNode*: proc (c: PContext; n: PNode; prev: PType): PType {...}{.nimcall.}
      semInferredLambda*: proc (c: PContext; pt: TIdTable; n: PNode): PNode
      semGenerateInstance*: proc (c: PContext; fn: PSym; pt: TIdTable;
                                  info: TLineInfo): PSym
      includedFiles*: IntSet
      pureEnumFields*: TStrTable
      userPragmas*: TStrTable
      evalContext*: PEvalContext
      unknownIdents*: IntSet
      generics*: seq[TInstantiationPair]
      topStmts*: int
      lastGenericIdx*: int
      hloLoopDetector*: int
      inParallelStmt*: int
      instTypeBoundOp*: proc (c: PContext; dc: PSym; t: PType; info: TLineInfo;
                              op: TTypeAttachedOp; col: int): PSym {...}{.nimcall.}
      selfName*: PIdent
      cache*: IdentCache
      graph*: ModuleGraph
      signatures*: TStrTable
      recursiveDep*: string
      suggestionsMade*: bool
      features*: set[Feature]
      inTypeContext*: int
      typesWithOps*: seq[(PType, PType)]
      unusedImports*: seq[(PSym, TLineInfo)]
      exportIndirections*: HashSet[(int, int)]
      lastTLineInfo*: TLineInfo

  Source Edit

# Procs

    proc makeInstPair(s: PSym; inst: PInstantiation): TInstantiationPair {...}{.
        raises: [], tags: [].}

  Source Edit

    proc filename(c: PContext): string {...}{.raises: [], tags: [].}

  Source Edit

    proc scopeDepth(c: PContext): int {...}{.inline, raises: [], tags: [].}

  Source Edit

    proc getCurrOwner(c: PContext): PSym {...}{.raises: [], tags: [].}

  Source Edit

    proc pushOwner(c: PContext; owner: PSym) {...}{.raises: [], tags: [].}

  Source Edit

    proc popOwner(c: PContext) {...}{.raises: [Exception, ValueError, IOError,
                                          ERecoverableError], tags: [RootEffect,
        WriteIOEffect, ReadIOEffect, ReadEnvEffect].}

  Source Edit

    proc lastOptionEntry(c: PContext): POptionEntry {...}{.raises: [], tags: [].}

  Source Edit

    proc popProcCon(c: PContext) {...}{.inline, raises: [], tags: [].}

  Source Edit

    proc put(p: PProcCon; key, val: PSym) {...}{.raises: [], tags: [].}

  Source Edit

    proc get(p: PProcCon; key: PSym): PSym {...}{.raises: [], tags: [].}

  Source Edit

    proc getGenSym(c: PContext; s: PSym): PSym {...}{.raises: [], tags: [].}

  Source Edit

    proc considerGenSyms(c: PContext; n: PNode) {...}{.raises: [], tags: [].}

  Source Edit

    proc newOptionEntry(conf: ConfigRef): POptionEntry {...}{.raises: [], tags: [].}

  Source Edit

    proc pushOptionEntry(c: PContext): POptionEntry {...}{.raises: [], tags: [].}

  Source Edit

    proc popOptionEntry(c: PContext) {...}{.raises: [], tags: [].}

  Source Edit

    proc newContext(graph: ModuleGraph; module: PSym): PContext {...}{.raises: [],
        tags: [].}

  Source Edit

    proc addConverter(c: PContext; conv: PSym) {...}{.raises: [], tags: [].}

  Source Edit

    proc addPattern(c: PContext; p: PSym) {...}{.raises: [], tags: [].}

  Source Edit

    proc newLib(kind: TLibKind): PLib {...}{.raises: [], tags: [].}

  Source Edit

    proc addToLib(lib: PLib; sym: PSym) {...}{.raises: [], tags: [].}

  Source Edit

    proc newTypeS(kind: TTypeKind; c: PContext): PType {...}{.raises: [], tags: [].}

  Source Edit

    proc makePtrType(owner: PSym; baseType: PType): PType {...}{.raises: [], tags: [].}

  Source Edit

    proc makePtrType(c: PContext; baseType: PType): PType {...}{.raises: [], tags: [].}

  Source Edit

    proc makeTypeWithModifier(c: PContext; modifier: TTypeKind; baseType: PType): PType {...}{.
        raises: [], tags: [].}

  Source Edit

    proc makeVarType(c: PContext; baseType: PType; kind = tyVar): PType {...}{.
        raises: [], tags: [].}

  Source Edit

    proc makeVarType(owner: PSym; baseType: PType; kind = tyVar): PType {...}{.
        raises: [], tags: [].}

  Source Edit

    proc makeTypeDesc(c: PContext; typ: PType): PType {...}{.raises: [], tags: [].}

  Source Edit

    proc makeTypeSymNode(c: PContext; typ: PType; info: TLineInfo): PNode {...}{.
        raises: [Exception, ValueError, IOError, ERecoverableError],
        tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}

  Source Edit

    proc makeTypeFromExpr(c: PContext; n: PNode): PType {...}{.raises: [], tags: [].}

  Source Edit

    proc newTypeWithSons(owner: PSym; kind: TTypeKind; sons: seq[PType]): PType {...}{.
        raises: [], tags: [].}

  Source Edit

    proc newTypeWithSons(c: PContext; kind: TTypeKind; sons: seq[PType]): PType {...}{.
        raises: [], tags: [].}

  Source Edit

    proc makeStaticExpr(c: PContext; n: PNode): PNode {...}{.raises: [], tags: [].}

  Source Edit

    proc makeAndType(c: PContext; t1, t2: PType): PType {...}{.raises: [], tags: [].}

  Source Edit

    proc makeOrType(c: PContext; t1, t2: PType): PType {...}{.raises: [], tags: [].}

  Source Edit

    proc makeNotType(c: PContext; t1: PType): PType {...}{.raises: [], tags: [].}

  Source Edit

    proc makeRangeWithStaticExpr(c: PContext; n: PNode): PType {...}{.
        raises: [Exception, ValueError, IOError, ERecoverableError],
        tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}

  Source Edit

    proc errorType(c: PContext): PType {...}{.raises: [], tags: [].}

  creates a type representing an error state Source Edit

    proc errorNode(c: PContext; n: PNode): PNode {...}{.raises: [], tags: [].}

  Source Edit

    proc fillTypeS(dest: PType; kind: TTypeKind; c: PContext) {...}{.raises: [], tags: [].}

  Source Edit

    proc makeRangeType(c: PContext; first, last: BiggestInt; info: TLineInfo;
                       intType: PType = nil): PType {...}{.
        raises: [Exception, ValueError, IOError, ERecoverableError],
        tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}

  Source Edit

    proc markIndirect(c: PContext; s: PSym) {...}{.inline, raises: [], tags: [].}

  Source Edit

    proc illFormedAst(n: PNode; conf: ConfigRef) {...}{.
        raises: [Exception, ValueError, IOError, ERecoverableError],
        tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}

  Source Edit

    proc illFormedAstLocal(n: PNode; conf: ConfigRef) {...}{.
        raises: [Exception, ValueError, IOError, ERecoverableError],
        tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}

  Source Edit

    proc checkSonsLen(n: PNode; length: int; conf: ConfigRef) {...}{.
        raises: [Exception, ValueError, IOError, ERecoverableError],
        tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}

  Source Edit

    proc checkMinSonsLen(n: PNode; length: int; conf: ConfigRef) {...}{.
        raises: [Exception, ValueError, IOError, ERecoverableError],
        tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}

  Source Edit

    proc isTopLevel(c: PContext): bool {...}{.inline, raises: [], tags: [].}

  Source Edit

    proc pushCaseContext(c: PContext; caseNode: PNode) {...}{.raises: [], tags: [].}

  Source Edit

    proc popCaseContext(c: PContext) {...}{.raises: [], tags: [].}

  Source Edit

    proc setCaseContextIdx(c: PContext; idx: int) {...}{.raises: [], tags: [].}

  Source Edit

# Templates

    template config(c: PContext): ConfigRef

  Source Edit

    template rangeHasUnresolvedStatic(t: PType): bool

  Source Edit