Types
TLookupFlag = enum checkAmbiguity, checkUndeclared, checkModule, checkPureEnumFields
- Source Edit
TOverloadIter = object it*: TIdentIter mit*: ModuleIter m*: PSym mode*: TOverloadIterMode symChoiceIndex*: int
- Source Edit
TOverloadIterMode = enum oimDone, oimNoQualifier, oimSelfModule, oimOtherModule, oimSymChoice, oimSymChoiceLocalLookup
- Source Edit
Procs
proc addInterfaceDecl(c: PContext; sym: PSym) {.inline, ...raises: [KeyError, Exception, ValueError, IOError, ERecoverableError], tags: [ RootEffect, ReadDirEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect], forbids: [].}
- adds a decl and the interface if appropriate Source Edit
proc addInterfaceDeclAt(c: PContext; scope: PScope; sym: PSym) {. ...raises: [KeyError, Exception, ValueError, IOError, ERecoverableError], tags: [ RootEffect, ReadDirEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect], forbids: [].}
- adds a symbol on the scope and the interface if appropriate Source Edit
proc addInterfaceOverloadableSymAt(c: PContext; scope: PScope; sym: PSym) {. ...raises: [Exception, ValueError, KeyError, IOError, ERecoverableError], tags: [ RootEffect, ReadDirEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect], forbids: [].}
- adds an overloadable symbol on the scope and the interface if appropriate Source Edit
proc addOverloadableSymAt(c: PContext; scope: PScope; fn: PSym) {. ...raises: [Exception, ValueError, KeyError, IOError, ERecoverableError], tags: [ RootEffect, ReadDirEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect], forbids: [].}
- adds an symbol to the given scope, will check for and raise errors if it's a redefinition as opposed to an overload. Source Edit
proc addPrelimDecl(c: PContext; sym: PSym) {....raises: [], tags: [], forbids: [].}
- Source Edit
proc ambiguousIdentifierMsg(candidates: seq[PSym]; prefix = "use one of"; indent = 0): string {. ...raises: [ValueError, Exception, KeyError], tags: [RootEffect], forbids: [].}
- Source Edit
proc ambiguousIdentifierMsg(choices: PNode; indent = 0): string {. ...raises: [ValueError, Exception, KeyError], tags: [RootEffect], forbids: [].}
- Source Edit
proc closeScope(c: PContext) {....raises: [Exception], tags: [RootEffect], forbids: [].}
- Source Edit
proc closeShadowScope(c: PContext) {....raises: [], tags: [], forbids: [].}
- closes the shadow scope, but doesn't merge any of the symbols Does not check for unused symbols or missing forward decls since a macro or template consumes this AST Source Edit
proc considerQuotedIdent(c: PContext; n: PNode; origin: PNode = nil): PIdent {. ...raises: [Exception, KeyError, ValueError, IOError, ERecoverableError], tags: [ RootEffect, ReadDirEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect], forbids: [].}
- Retrieve a PIdent from a PNode, taking into account accent nodes. origin can be nil. If it is not nil, it is used for a better error message. Source Edit
proc debugScopes(c: PContext; limit = 0; max = int.high) {....deprecated, raises: [], tags: [], forbids: [].}
- Source Edit
proc errorUndeclaredIdentifier(c: PContext; info: TLineInfo; name: string; extra = "") {. ...raises: [Exception, ValueError, KeyError, IOError, ERecoverableError], tags: [ RootEffect, ReadDirEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect], forbids: [].}
- Source Edit
proc errorUseQualifier(c: PContext; info: TLineInfo; candidates: seq[PSym]) {. ...raises: [Exception, ValueError, KeyError, IOError, ERecoverableError], tags: [ RootEffect, ReadDirEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect], forbids: [].}
- Source Edit
proc getSymRepr(conf: ConfigRef; s: PSym; getDeclarationPath = true): string {. ...raises: [Exception, KeyError, ValueError], tags: [RootEffect, ReadDirEffect], forbids: [].}
- Source Edit
proc initOverloadIter(o: var TOverloadIter; c: PContext; n: PNode): PSym {. ...raises: [Exception, KeyError, ValueError, IOError, ERecoverableError], tags: [ RootEffect, ReadDirEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect], forbids: [].}
- Source Edit
proc isShadowScope(s: PScope): bool {.inline, ...raises: [], tags: [], forbids: [].}
- Source Edit
proc lastOverloadScope(o: TOverloadIter): int {....raises: [], tags: [], forbids: [].}
- Source Edit
proc mergeShadowScope(c: PContext) {....raises: [Exception, ValueError, KeyError, IOError, ERecoverableError], tags: [RootEffect, ReadDirEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect], forbids: [].}
-
close the existing scope and merge in all defined symbols, this will also trigger any export related code if this is into a non-shadow scope.
Merges: shadow -> shadow: add symbols to the parent but check for redefinitions etc shadow -> non-shadow: the above, but also handle exports and all that
Source Edit proc nextOverloadIter(o: var TOverloadIter; c: PContext; n: PNode): PSym {. ...raises: [KeyError, Exception], tags: [ReadDirEffect, RootEffect], forbids: [].}
- Source Edit
proc openShadowScope(c: PContext) {....raises: [], tags: [], forbids: [].}
- opens a shadow scope, just like any other scope except the depth is the same as the parent -- see isShadowScope. Source Edit
proc qualifiedLookUp(c: PContext; n: PNode; flags: set[TLookupFlag]): PSym {. ...raises: [Exception, KeyError, ValueError, IOError, ERecoverableError], tags: [ RootEffect, ReadDirEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect], forbids: [].}
- Source Edit
proc rawCloseScope(c: PContext) {....raises: [], tags: [], forbids: [].}
- Source Edit
proc wrongRedefinition(c: PContext; info: TLineInfo; s: string; conflictsWith: TLineInfo; note = errGenerated) {. ...raises: [Exception, ValueError, KeyError, IOError, ERecoverableError], tags: [ RootEffect, ReadDirEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect], forbids: [].}
- Emit a redefinition error if in non-interactive mode Source Edit