CompilesId = int
system.compiles. See the seminst module. Source Edit IdGenerator = ref object module*: int32 symId*: int32 typeId*: int32 sealed*: bool disambTable*: CountTable[PIdent]
TCallingConvention = enum ccNimCall = "nimcall", ccStdCall = "stdcall", ccCDecl = "cdecl", ccSafeCall = "safecall", ccSysCall = "syscall", ccInline = "inline", ccNoInline = "noinline", ccFastCall = "fastcall", ccThisCall = "thiscall", ccClosure = "closure", ccNoConvention = "noconv", ccMember = "member"
TLib = object kind*: TLibKind generated*: bool isOverridden*: bool name*: Rope path*: PNode
TLoc = object k*: TLocKind storage*: TStorageLoc flags*: TLocFlags lode*: PNode snippet*: Rope
TLocFlag = enum lfIndirect, lfNoDeepCopy, lfNoDecl, lfDynamicLib, lfExportLib, lfHeader, lfImportCompilerProc, lfSingleUse, lfEnforceDeref, lfPrepareForMutation
TLocKind = enum locNone, locTemp, locLocalVar, locGlobalVar, locParam, locField, locExpr, locProc, locData, locCall, locOther
TMagic = enum mNone, mDefined, mDeclared, mDeclaredInScope, mCompiles, mArrGet, mArrPut, mAsgn, mLow, mHigh, mSizeOf, mAlignOf, mOffsetOf, mTypeTrait, mIs, mOf, mAddr, mType, mTypeOf, mPlugin, mEcho, mShallowCopy, mSlurp, mStaticExec, mStatic, mParseExprToAst, mParseStmtToAst, mExpandToAst, mQuoteAst, mInc, mDec, mOrd, mNew, mNewFinalize, mNewSeq, mNewSeqOfCap, mLengthOpenArray, mLengthStr, mLengthArray, mLengthSeq, mIncl, mExcl, mCard, mChr, mGCref, mGCunref, mAddI, mSubI, mMulI, mDivI, mModI, mSucc, mPred, mAddF64, mSubF64, mMulF64, mDivF64, mShrI, mShlI, mAshrI, mBitandI, mBitorI, mBitxorI, mMinI, mMaxI, mAddU, mSubU, mMulU, mDivU, mModU, mEqI, mLeI, mLtI, mEqF64, mLeF64, mLtF64, mLeU, mLtU, mEqEnum, mLeEnum, mLtEnum, mEqCh, mLeCh, mLtCh, mEqB, mLeB, mLtB, mEqRef, mLePtr, mLtPtr, mXor, mEqCString, mEqProc, mUnaryMinusI, mUnaryMinusI64, mAbsI, mNot, mUnaryPlusI, mBitnotI, mUnaryPlusF64, mUnaryMinusF64, mCharToStr, mBoolToStr, mCStrToStr, mStrToStr, mEnumToStr, mAnd, mOr, mImplies, mIff, mExists, mForall, mOld, mEqStr, mLeStr, mLtStr, mEqSet, mLeSet, mLtSet, mMulSet, mPlusSet, mMinusSet, mConStrStr, mSlice, mDotDot, mFields, mFieldPairs, mOmpParFor, mAppendStrCh, mAppendStrStr, mAppendSeqElem, mInSet, mRepr, mExit, mSetLengthStr, mSetLengthSeq, mIsPartOf, mAstToStr, mParallel, mSwap, mIsNil, mArrToSeq, mOpenArrayToSeq, mNewString, mNewStringOfCap, mParseBiggestFloat, mMove, mEnsureMove, mWasMoved, mDup, mDestroy, mTrace, mDefault, mUnown, mFinished, mIsolate, mAccessEnv, mAccessTypeField, mArray, mOpenArray, mRange, mSet, mSeq, mVarargs, mRef, mPtr, mVar, mDistinct, mVoid, mTuple, mOrdinal, mIterableType, mInt, mInt8, mInt16, mInt32, mInt64, mUInt, mUInt8, mUInt16, mUInt32, mUInt64, mFloat, mFloat32, mFloat64, mFloat128, mBool, mChar, mString, mCstring, mPointer, mNil, mExpr, mStmt, mTypeDesc, mVoidType, mPNimrodNode, mSpawn, mDeepCopy, mIsMainModule, mCompileDate, mCompileTime, mProcCall, mCpuEndian, mHostOS, mHostCPU, mBuildOS, mBuildCPU, mAppType, mCompileOption, mCompileOptionArg, mNLen, mNChild, mNSetChild, mNAdd, mNAddMultiple, mNDel, mNKind, mNSymKind, mNccValue, mNccInc, mNcsAdd, mNcsIncl, mNcsLen, mNcsAt, mNctPut, mNctLen, mNctGet, mNctHasNext, mNctNext, mNIntVal, mNFloatVal, mNSymbol, mNIdent, mNGetType, mNStrVal, mNSetIntVal, mNSetFloatVal, mNSetSymbol, mNSetIdent, mNSetStrVal, mNLineInfo, mNNewNimNode, mNCopyNimNode, mNCopyNimTree, mStrToIdent, mNSigHash, mNSizeOf, mNBindSym, mNCallSite, mEqIdent, mEqNimrodNode, mSameNodeType, mGetImpl, mNGenSym, mNHint, mNWarning, mNError, mInstantiationInfo, mGetTypeInfo, mGetTypeInfoV2, mNimvm, mIntDefine, mStrDefine, mBoolDefine, mGenericDefine, mRunnableExamples, mException, mBuiltinType, mSymOwner, mUncheckedArray, mGetImplTransf, mSymIsInstantiationOf, mNodeId, mPrivateAccess, mZeroDefault
TNode {.final, acyclic.} = object
when defined(useNodeIds):
id*: int
typ*: PType
info*: TLineInfo
flags*: TNodeFlags
case kind*: TNodeKind
of nkCharLit .. nkUInt64Lit:
intVal*: BiggestInt
of nkFloatLit .. nkFloat128Lit:
floatVal*: BiggestFloat
of nkStrLit .. nkTripleStrLit:
strVal*: string
of nkSym:
sym*: PSym
of nkIdent:
ident*: PIdent
else:
sons*: TNodeSeq
when defined(nimsuggest):
endInfo*: TLineInfoTNodeFlag = enum nfNone, nfBase2, nfBase8, nfBase16, nfAllConst, nfTransf, nfNoRewrite, nfSem, nfLL, nfDotField, nfDotSetter, nfExplicitCall, nfExprCall, nfIsRef, nfIsPtr, nfPreventCg, nfBlockArg, nfFromTemplate, nfDefaultParam, nfDefaultRefsParam, nfExecuteOnReload, nfLastRead, nfFirstWrite, nfHasComment, nfSkipFieldChecking, nfDisabledOpenSym
TScope {.acyclic.} = object
depthLevel*: int
symbols*: TStrTable
parent*: PScope
allowPrivateAccess*: seq[PSym]TSym {.acyclic.} = object
itemId*: ItemId
case kind*: TSymKind
of routineKinds:
gcUnsafetyReason*: PSym
transformedBody*: PNode
of skLet, skVar, skField, skForVar:
guard*: PSym
bitsize*: int
alignment*: int
else:
nil
magic*: TMagic
typ*: PType
name*: PIdent
info*: TLineInfo
when defined(nimsuggest):
endInfo*: TLineInfo
hasUserSpecifiedType*: bool
owner*: PSym
flags*: TSymFlags
ast*: PNode
options*: TOptions
position*: int
offset*: int32
disamb*: int32
loc*: TLoc
annex*: PLib
when hasFFI:
cname*: string
constraint*: PNode
instantiatedFrom*: PSym
when defined(nimsuggest):
allUsages*: seq[TLineInfo]TSymFlag = enum sfUsed, sfExported, sfFromGeneric, sfGlobal, sfForward, sfWasForwarded, sfImportc, sfExportc, sfMangleCpp, sfVolatile, sfRegister, sfPure, sfNoSideEffect, sfSideEffect, sfMainModule, sfSystemModule, sfNoReturn, sfAddrTaken, sfCompilerProc, sfEscapes, sfDiscriminant, sfRequiresInit, sfDeprecated, sfExplain, sfError, sfShadowed, sfThread, sfCppNonPod, sfCompileTime, sfConstructor, sfDispatcher, sfBorrow, sfInfixCall, sfNamedParamCall, sfDiscardable, sfOverridden, sfCallsite, sfGenSym, sfNonReloadable, sfGeneratedOp, sfTemplateParam, sfCursor, sfInjectDestructors, sfNeverRaises, sfSystemRaisesDefect, sfUsedInFinallyOrExcept, sfSingleUsedTemp, sfNoalias, sfEffectsDelayed, sfGeneratedType, sfVirtual, sfByCopy, sfMember, sfCodegenDecl, sfWasGenSym, sfForceLift, sfDirty, sfCustomPragma, sfBase, sfGoto, sfAnon, sfAllUntyped, sfTemplateRedefinition
TSymKind = enum skUnknown, skConditional, skDynLib, skParam, skGenericParam, skTemp, skModule, skType, skVar, skLet, skConst, skResult, skProc, skFunc, skMethod, skIterator, skConverter, skMacro, skTemplate, skField, skEnumField, skForVar, skLabel, skStub, skPackage
TType {.acyclic.} = object
itemId*: ItemId
kind*: TTypeKind
callConv*: TCallingConvention
flags*: TTypeFlags
n*: PNode
owner*: PSym
sym*: PSym
size*: BiggestInt
align*: int16
paddingAtEnd*: int16
loc*: TLoc
typeInst*: PType
uniqueId*: ItemIdTTypeAttachedOp = enum attachedWasMoved, attachedDestructor, attachedAsgn, attachedDup, attachedSink, attachedTrace, attachedDeepCopy
TTypeFlag = enum tfVarargs, tfNoSideEffect, tfFinal, tfInheritable, tfHasOwned, tfEnumHasHoles, tfShallow, tfThread, tfFromGeneric, tfUnresolved, tfResolved, tfRetType, tfCapturesEnv, tfByCopy, tfByRef, tfIterator, tfPartial, tfNotNil, tfRequiresInit, tfNeedsFullInit, tfVarIsPtr, tfHasMeta, tfHasGCedMem, tfPacked, tfHasStatic, tfGenericTypeParam, tfImplicitTypeParam, tfInferrableStatic, tfConceptMatchedTypeSym, tfExplicit, tfWildcard, tfHasAsgn, tfBorrowDot, tfTriggersCompileTime, tfRefsAnonObj, tfCovariant, tfWeakCovariant, tfContravariant, tfCheckedForDestructor, tfAcyclic, tfIncompleteStruct, tfCompleteStruct, tfExplicitCallConv, tfIsConstructor, tfEffectSystemWorkaround, tfIsOutParam, tfSendable, tfImplicitStatic
TTypeKind = enum tyNone, tyBool, tyChar, tyEmpty, tyAlias, tyNil, tyUntyped, tyTyped, tyTypeDesc, tyGenericInvocation, tyGenericBody, tyGenericInst, tyGenericParam, tyDistinct, tyEnum, tyOrdinal, tyArray, tyObject, tyTuple, tySet, tyRange, tyPtr, tyRef, tyVar, tySequence, tyProc, tyPointer, tyOpenArray, tyString, tyCstring, tyForward, tyInt, tyInt8, tyInt16, tyInt32, tyInt64, tyFloat, tyFloat32, tyFloat64, tyFloat128, tyUInt, tyUInt8, tyUInt16, tyUInt32, tyUInt64, tyOwned, tySink, tyLent, tyVarargs, tyUncheckedArray, tyError, tyBuiltInTypeClass, tyUserTypeClass, tyUserTypeClassInst, tyCompositeTypeClass, tyInferred, tyAnd, tyOr, tyNot, tyAnything, tyStatic, tyFromExpr, tyConcept, tyVoid, tyIterable
abstractInst = {tyGenericInst, tyDistinct, tyOrdinal, tyTypeDesc, tyAlias,
tyInferred, tySink, tyOwned}abstractVarRange = {tyGenericInst, tyRange, tyVar, tyDistinct, tyOrdinal,
tyTypeDesc, tyAlias, tyInferred, tySink, tyOwned}AttachedOpToStr: array[TTypeAttachedOp, string] = ["=wasMoved", "=destroy",
"=copy", "=dup", "=sink", "=trace", "=deepcopy"]ConcreteTypes: TTypeKinds = {tyBool, tyChar, tyEnum, tyArray, tyObject, tySet,
tyTuple, tyRange, tyPtr, tyRef, tyVar, tyLent,
tySequence, tyProc, tyPointer, tyOpenArray,
tyString, tyCstring, tyInt..tyInt64,
tyFloat..tyFloat128, tyUInt..tyUInt64}ctfeWhitelist = {mNone, mSucc, mPred, mInc, mDec, mOrd, mLengthOpenArray,
mLengthStr, mLengthArray, mLengthSeq, mArrGet, mArrPut, mAsgn,
mDestroy, mIncl, mExcl, mCard, mChr, mAddI, mSubI, mMulI,
mDivI, mModI, mAddF64, mSubF64, mMulF64, mDivF64, mShrI, mShlI,
mBitandI, mBitorI, mBitxorI, mMinI, mMaxI, mAddU, mSubU, mMulU,
mDivU, mModU, mEqI, mLeI, mLtI, mEqF64, mLeF64, mLtF64, mLeU,
mLtU, mEqEnum, mLeEnum, mLtEnum, mEqCh, mLeCh, mLtCh, mEqB,
mLeB, mLtB, mEqRef, mEqProc, mLePtr, mLtPtr, mEqCString, mXor,
mUnaryMinusI, mUnaryMinusI64, mAbsI, mNot, mUnaryPlusI,
mBitnotI, mUnaryPlusF64, mUnaryMinusF64, mCharToStr,
mBoolToStr, mCStrToStr, mStrToStr, mEnumToStr, mAnd, mOr,
mEqStr, mLeStr, mLtStr, mEqSet, mLeSet, mLtSet, mMulSet,
mPlusSet, mMinusSet, mConStrStr, mAppendStrCh, mAppendStrStr,
mAppendSeqElem, mInSet, mRepr, mOpenArrayToSeq}generatedMagics = {mNone, mIsolate, mFinished, mOpenArrayToSeq}IntegralTypes = {tyBool, tyChar, tyEnum, tyInt..tyInt64, tyFloat..tyFloat128,
tyUInt..tyUInt64}nkIdentKinds = {nkIdent, nkSym, nkAccQuoted, nkOpenSymChoice, nkClosedSymChoice,
nkOpenSym}nodesToIgnoreSet = {nkNone..nkIdent, nkType..nkNilLit, nkTypeSection, nkProcDef,
nkConverterDef, nkMethodDef, nkIteratorDef, nkMacroDef,
nkTemplateDef, nkLambda, nkDo, nkFuncDef, nkConstSection,
nkConstDef, nkIncludeStmt, nkImportStmt, nkExportStmt,
nkPragma, nkCommentStmt, nkBreakState, nkTypeOfExpr,
nkMixinStmt, nkBindStmt}OverloadableSyms = {skProc, skFunc, skMethod, skIterator, skConverter, skModule,
skTemplate, skMacro, skEnumField}PersistentNodeFlags: TNodeFlags = {nfBase2, nfBase8, nfBase16, nfDotSetter,
nfDotField, nfIsRef, nfIsPtr, nfPreventCg,
nfLL, nfFromTemplate, nfDefaultRefsParam,
nfExecuteOnReload, nfLastRead, nfFirstWrite,
nfSkipFieldChecking, nfDisabledOpenSym}StructuralEquivTypes: TTypeKinds = {tyNil, tyTuple, tyArray, tySet, tyRange,
tyPtr, tyRef, tyVar, tyLent, tySequence,
tyProc, tyOpenArray, tyVarargs}tfNonConstExpr = tfExplicitCallConv
tyMetaTypes = {tyUntyped, tyTypeDesc, tyGenericParam,
tyBuiltInTypeClass..tyCompositeTypeClass, tyAnd..tyAnything}proc isGenericRoutine(s: PSym): bool {.inline, ...raises: [], tags: [], forbids: [].}determines if this symbol represents a generic routine or an instance of one. This should be renamed accordingly and isGenericRoutineStrict should take this name instead.
Warning/XXX: Unfortunately, it considers a proc kind symbol flagged with sfFromGeneric as a generic routine. Instead this should likely not be the case and the concepts should be teased apart:
proc newAtom(ident: PIdent; info: TLineInfo): PNode {....raises: [], tags: [],
forbids: [].}proc newAtom(kind: TNodeKind; floatVal: BiggestFloat; info: TLineInfo): PNode {.
...raises: [], tags: [], forbids: [].}proc skipTypes(t: PType; kinds: TTypeKinds): PType {....raises: [], tags: [],
forbids: [].}
© 2006–2024 Andreas Rumpf
Licensed under the MIT License.
https://nim-lang.org/docs/compiler/ast.html
proc comment(n: PNode): string {....raises: [KeyError], tags: [], forbids: [].}