compiler/ast/report_enums

  Source   Edit

Types

BackendReportKind = range[rbackCannotWriteScript .. rbackLinking]
  Source   Edit
CmdReportKind = range[rcmdFailedExecution .. rcmdRunnableExamplesSuccess]
  Source   Edit
DebugReportKind = range[rdbgVmExecTraceFull .. rdbgOptionsPop]
  Source   Edit
ExternalReportKind = range[rextCmdRequiresFile .. rextPath]
  Source   Edit
InternalReportKind = range[rintUnreachable .. rintEchoMessage]
  Source   Edit
LexerReportKind = range[rlexMalformedNumUnderscores ..
    rlexSourceCodeFilterOutput]
  Source   Edit
ParserReportKind = range[rparInvalidIndentation .. rparEnablePreviewDotOps]
  Source   Edit
ReportCategory = enum
  repParser = "Parser", repLexer = "Lexer", ## Report generated by lexer - bad tokens, lines
                                             ## that are too long etc.
  repSem = "Sem",           ## Report produced directly by semantic analysis -
                             ## compilation errors, warnings and hints
  repCmd = "Cmd", ## Report related to execution of the external command -
                   ## start of the command, execution failure, succes and so on.
  repVM = "VM",             ## Report related to embedded virtual machine
  repDebug = "Debug",       ## Side channel for the compiler debug report. Helper
                             ## messages designed specifically to aid development of the compiler
  repInternal = "Internal", ## Reports constructed during handling of
                             ## internal compilation errors. Separate from debugging reports since
                             ## they always exist - ICE, internal fatal errors etc.
  repBackend = "Backend",   ## Backend-specific reports.
  repExternal = "External"   ## Report constructed during handling of
                             ## configuration, packages, modules.
Kinds of the toplevel reports. Only dispatches on report topics, such as sem, parse, macro (for echo in compile-time code) and so on. Subdivision is based on different phases of the compiler operation, and not on report's state itself, as those are completely orthogonal to each other (lexer might provide errors and hints, parser can provide errors, hints and warnings)   Source   Edit
ReportKind = enum
  repNone, rintUnreachable, ## State in the compiler code that must not be reached
  rintAssert,               ## Failed internal assert in the compiler
  rintCannotOpenFile, rintUsingLeanCompiler, rintNotUsingNimcore,
  rintNotImplemented, rintWarnCannotOpenFile, rintUnexpected,
  rintWarnFileChanged, rintSource = "Source", ## Show source in the report
  rintMsgOrigin = "MsgOrigin", rintErrKind = "ErrKind", ## Show report kind in error messages
  rintQuitCalled = "QuitCalled", ## `quit()` called by the macro code
                                  ## compilation error handling and similar
  rintMissingStackTrace,    ## Stack trace would've been generated in the
                             ## debug compiler build
  rintSuccessX = "SuccessX", ## Successful compilation, only used as a "note",
                              ## it's not a hint either
  rintStackTrace = "StackTrace", ## Stack trace during internal
  rintListWarnings, rintListHints, rintEchoMessage, rextCmdRequiresFile, ## fatal error, user failed to provide a file
  rextConf = "Conf",        ## Processed user configutation file; not a "report"
  rextPath = "Path",        ## Add nimble path; xxx: this isn't a "report"
  rlexMalformedNumUnderscores, rlexMalformedIdentUnderscores,
  rlexMalformedTrailingUnderscre, rlexInvalidToken,
  rlexInvalidTokenSpaceBetweenNumAndIdent, rlexNoTabs,
  rlexInvalidIntegerLiteralOctalPrefix, rlexInvalidIntegerSuffix,
  rlexNumberNotInRange, rlexExpectedHex, rlexInvalidIntegerLiteral,
  rlexInvalidNumericLiteral, rlexInvalidCharLiteral,
  rlexInvalidCharLiteralConstant, rlexInvalidCharLiteralPlatformNewline,
  rlexInvalidCharLiteralUnicodeCodepoint, rlexMissingClosingApostrophe,
  rlexInvalidUnicodeCodepointEmpty,
  rlexInvalidUnicodeCodepointGreaterThan0x10FFFF, rlexUnclosedTripleString,
  rlexUnclosedSingleString, rlexUnclosedComment,
  rlexDeprecatedOctalPrefix = "OctalEscape", rlexLineTooLong = "LineTooLong",
  rlexLinterReport = "Name",
  rlexSourceCodeFilterOutput = "SourceCodeFilterOutput", rparInvalidIndentation,
  rparInvalidIndentationWithForgotEqualSignHint,
  rparNestableRequiresIndentation, rparIdentExpected,
  rparIdentExpectedEmptyAccQuote, rparExprExpected, rparMissingToken,
  rparUnexpectedToken, rparAsmStmtExpectsStrLit, rparFuncNotAllowed,
  rparTupleTypeWithPar, rparMisplacedParameterVar, rparConceptNotinType,
  rparMisplacedExport, rparPragmaBeforeGenericParameters,
  rparTemplMissingEndClose, rparTemplInvalidExpression, rparInvalidFilter,
  rparInconsistentSpacing = "Spacing", rparPragmaNotFollowingTypeName,
  rparEnablePreviewDotOps = "DotLikeOps", rvmOpcParseExpectedExpression,
  rvmTooManyRegistersRequired, rvmMissingImportcCompleteStruct, rvmNotUnused,
  rvmUserError, rvmTooLargetOffset, rvmUnhandledException,
  rvmCannotGenerateCode, rvmCannotCast, rvmCannotEvaluateAtComptime,
  rvmCannotImportc, rvmCannotCallMethod, rvmCannotModifyTypechecked,
  rvmNilAccess, rvmAccessOutOfBounds, rvmAccessTypeMismatch,
  rvmAccessNoLocation, rvmErrInternal, rvmIndexError, rvmOutOfRange,
  rvmOverOrUnderflow, rvmDivisionByConstZero, rvmNodeNotASymbol,
  rvmNodeNotAProcSymbol, rvmIllegalConv, rvmIllegalConvFromXToY,
  rvmMissingCacheKey, rvmCacheKeyAlreadyExists, rvmFieldNotFound,
  rvmFieldInavailable, rvmCannotCreateNode, rvmCannotSetChild,
  rvmCannotAddChild, rvmCannotGetChild, rvmNoType, rvmNotAField,
  rvmUnsupportedNonNil, rvmQuit, rvmTooManyIterations, rvmStackTrace,
  rsemFatalError, rsemUserError = "UserError", ## `{.error: }`
  rsemUsageIsError, rsemCompilesHasSideEffects, ## lightweight to avoid heavy diagnostic
                                                 ## querying for compiles context
  rsemCustomError, rsemCustomPrintMsgAndNodeError, ## just like custom error, prints a message and renders wrongNode
  rsemTypeMismatch, rsemTypeKindMismatch, rsemAmbiguous,
  rsemAmbiguousIdentWithCandidates, rsemAmbiguousIdent, rsemCustomUserError, ## just like customer error, but reported as a errUser in msgs
  rsemNodeNotAllowed,       ## Generated in `filters.nim`
                             ## TODO: this is not a sem error, it's a source filters error
  rsemCannotProveNotNil, rsemProvablyNil, rsemSugNoSymbolAtPosition, rsemCustomGlobalError, ## just like custom error, but treat it like a "raise" and fast track the
                                                                                             ## "graceful" abort of this compilation run, used by `errorreporting` to
                                                                                             ## bridge into the existing `msgs.liMessage` and `msgs.handleError`.
  rsemSystemNeeds, rsemInvalidModulePath, rsemInvalidModuleName,
  rsemCannotImportItself, rsemRecursiveInclude, rsemCannotOpenFile,
  rsemExportRequiresToplevel, rsemExperimentalRequiresToplevel,
  rsemMethodRequiresToplevel, rsemPackageRequiresToplevel,
  rsemConverterRequiresToplevel, rsemImportRequiresToplevel,
  rsemUnexpectedToplevelDefer, rsemUsingRequiresToplevel, rsemInvalidVisibility,
  rsemUnknownPackageName, rsemUnexpectedInfixInInclude,
  rsemConflictingExportnims, rsemNoMagicEqualsForType,
  rsemCantConvertLiteralToType, rsemCantConvertLiteralToRange,
  rsemCantComputeOffsetof, rsemStaticOutOfBounds, ## Error generated when semfold or static bound
                                                   ## checking sees and out-of-bounds index error.
  rsemStaticFieldNotFound, rsemSemfoldOverflow, rsemSemfoldDivByZero,
  rsemInvalidIntdefine, rsemInvalidBooldefine, rsemCaseInUnion, ## `{.union.}` type cannot use `case:` statements
  rsemOffsetInUnion, ## `{.union.}` type cannot use inheritance and any
                      ## other features that add implicit chunk of data before the actually
                      ## listed fields.
  rsemUnexpectedInNewConcept, rsemTooNestedConcept, rsemIllegalRecursion,
  rsemCannotInferStaticValue, rsemVarVarNotAllowed, ## `var lent`, `var var` etc. are not allowed in
                                                     ## types
  rsemInvalidOrderInEnum, rsemSetTooBig, rsemTIsNotAConcreteType,
  rsemProcIsNotAConcreteType, rsemRangeIsEmpty, rsemStringRangeNotAllowed,
  rsemCannotInstantiate, rsemCannotInstantiateWithParameter,
  rsemCannotInstantiateForwarded, rsemCannotGenerateGenericDestructor,
  rsemUndeclaredField, rsemExpectedOrdinal, rsemExpectedOrdinalOrFloat,
  rsemExpectedUnholyEnum, rsemExpectedLow0Discriminant,
  rsemExpectedHighCappedDiscriminant, rsemMissingCaseBranches,
  rsemRangeDoesNotSupportNan, rsemRangeRequiresDotDot, rsemExpectedRange,
  rsemArrayExpectsPositiveRange, rsemExpectObjectForBase,
  rsemExpectNonFinalForBase, rsemTVoidNotAllowed, rsemExpectedObjectForRegion,
  rsemUnexpectedVoidType, rsemUnexpectedArrayAssignForCstring,
  rsemMacroBodyDependsOnGenericTypes, rsemMalformedNotNilType,
  rsemEnableNotNilExperimental, rsemEnableDotOperatorsExperimental,
  rsemEnableCallOperatorExperimental, rsemUnexpectedPattern,
  rsemExpectedObjectType, rsemExpectedImportedType,
  rsemUnexpectedExportcInAlias, rsemExpectedDistinctForBorrow,
  rsemBorrowTargetNotFound, rsemConceptInferenceFailed,
  rsemConceptPredicateFailed, rsemImplementationNotAllowed,
  rsemImplementationExpected, rsemRedefinitionOf,
  rsemDefaultParamIsIncompatible, rsemDeclarationVisibilityMismatch,
  rsemGenericLambdaNowAllowed, rsemUnexpectedAutoInForwardDeclaration,
  rsemUnexpectedClosureOnToplevelProc, rsemExpectedReturnTypeForIterator,
  rsemExpectedReturnTypeForConverter, rsemExpectedOneArgumentForConverter,
  rsemIncompatibleDefaultExpr, rsemCallTypeMismatch,
  rsemCallIndirectTypeMismatch, rsemCallNotAProcOrField, ## unknown or semantically invalid `obj.field`,
                                                          ## `obj.call()`
  rsemExpressionCannotBeCalled, rsemWrongNumberOfArguments,
  rsemIsOperatorTakes2Args, rsemWrongNumberOfVariables,
  rsemWrongNumberOfGenericParams, rsemNoGenericParamsAllowed, rsemAmbiguousCall,
  rsemCallingConventionMismatch, rsemHasSideEffects, rsemCantPassProcvar,
  rsemHookCannotRaise, rsemUnlistedRaises, rsemUnlistedEffects,
  rsemOverrideSafetyMismatch, rsemOverrideLockMismatch,
  rsemMissingMethodDispatcher, rsemNotABaseMethod, rsemIllegalCallconvCapture,
  rsemIllegalMemoryCapture, rsemIllegalCompTimeCapture,
  rsemIgnoreInvalidForLoop, rsemMissingGenericParamsForTemplate,
  rsemMisplacedMagicType, rsemCannotInferParameterType,
  rsemParameterRequiresAType, rsemParameterRedefinition, rsemInvalidExpression,
  rsemExpectedNonemptyPattern, rsemTemplateInstantiationTooNested,
  rsemMacroInstantiationTooNested, rsemGenericInstantiationTooNested,
  rsemInvalidMethodDeclarationOrder, rsemParameterNotPointerToPartial,
  rsemDiscardingVoid, rsemDiscardingProc, rsemInvalidControlFlow,
  rsemExpectedLabel, rsemContinueCannotHaveLabel, rsemUseOrDiscard,
  rsemUseOrDiscardExpr, rsemCannotBeRaised, rsemCannotRaiseNonException,
  rsemExceptionAlreadyHandled, rsemCannotExceptNativeAndImported,
  rsemExpectedSingleFinally, rsemExpectedSingleGeneralExcept,
  rsemCannotConvertToRange, rsemUsingRequiresType, rsemUsingDisallowsAssign,
  rsemDifferentTypeForReintroducedSymbol, rsemCannotInferTypeOfLiteral,
  rsemCannotInferTypeOfParameter, rsemProcHasNoConcreteType,
  rsemThreadvarCannotInit, rsemLetNeedsInit, rsemConstExpressionExpected,
  rsemFieldsIteratorCannotContinue, rsemParallelFieldsDisallowsCase,
  rsemNoObjectOrTupleType, rsemForExpectsIterator,
  rsemSelectorMustBeOfCertainTypes, rsemTypeCannotBeForwarded,
  rsemDoubleCompletionOf, rsemExpectedInvariantParam,
  rsemCovariantUsedAsNonCovariant, rsemContravariantUsedAsNonCovariant,
  rsemNonInvariantCannotBeUsedWith, rsemNonInvariantCnnnotBeUsedInConcepts,
  rsemIncorrectResultProcSymbol, rsemRebidingImplicitDestructor,
  rsemRebidingDestructor, rsemRebidingDeepCopy, rsemInseparableTypeBoundOp,
  rsemUnexpectedTypeBoundOpSignature, rsemExpectedDestroyOrDeepCopyForOverride,
  rsemExpectedObjectForMethod, rsemUnexpectedPragmaInDefinitionOf,
  rsemMisplacedRunnableExample, rsemCannotReraise, rsemConstantOfTypeHasNoValue,
  rsemTypeConversionArgumentMismatch, rsemUnexpectedEqInObjectConstructor,
  rsemIllegalConversion, rsemCannotBeConvertedTo, rsemCannotCastToNonConcrete,
  rsemCannotCastTypes, rsemExpectedTypeOrValue, rsemInvalidArgumentFor,
  rsemNoTupleTypeForConstructor, rsemInvalidTupleConstructor,
  rsemUnknownIdentifier, rsemIndexOutOfBounds,
  rsemInvalidOrderInArrayConstructor, rsemVarForOutParamNeeded, rsemStackEscape,
  rsemExprHasNoAddress, rsemUnknownTrait, rsemStringOrIdentNodeExpected,
  rsemExpectedObjectForOf, rsemCannotBeOfSubtype, rsemQuantifierInRangeExpected,
  rsemOldTakesParameterName, rsemOldDoesNotBelongTo, rsemCannotFindPlugin,
  rsemCannotIsolate, rsemRecursiveDependencyIterator, rsemIllegalNimvmContext,
  rsemDisallowedNilDeref, rsemCannotDeref, rsemInvalidTupleSubscript,
  rsemLocalEscapesStackFrame, rsemImplicitAddrIsNotFirstParam,
  rsemCannotAssignTo, rsemNoReturnTypeDeclared, rsemReturnNotAllowed,
  rsemIllegalCompileTimeAccess, rsemCannotInferReturnType,
  rsemExpectedValueForYield, rsemUnexpectedYield, rsemYieldExpectedTupleConstr, ## 
                                                                                 ## a 
                                                                                 ## literal 
                                                                                 ## tuple 
                                                                                 ## constructor 
                                                                                 ## is 
                                                                                 ## required 
                                                                                 ## when 
                                                                                 ## the 
                                                                                 ## iterator 
                                                                                 ## returns 
                                                                                 ## a
                                                                                 ## 
                                                                                 ## tuple 
                                                                                 ## containing 
                                                                                 ## a 
                                                                                 ## view
  rsemCannotReturnTypeless, rsemExpectedMacroOrTemplate, rsemAmbiguousGetAst,
  rsemExpectedTemplateWithNArgs, rsemExpectedCallForGetAst,
  rsemWrongNumberOfQuoteArguments, rsemNamedExprExpected,
  rsemNamedExprNotAllowed, rsemFieldInitTwice,
  rsemDisallowedTypedescForTupleField, rsemDisjointFields,
  rsemUnsafeRuntimeDiscriminantInit, rsemConflictingDiscriminantInit,
  rsemConflictingDiscriminantValues, rsemRuntimeDiscriminantInitCap,
  rsemRuntimeDiscriminantMustBeImmutable, rsemRuntimeDiscriminantRequiresElif,
  rsemObjectRequiresFieldInit, rsemObjectRequiresFieldInitNoDefault,
  rsemObjectDoesNotHaveDefaultValue, rsemDistinctDoesNotHaveDefaultValue,
  rsemExpectedModuleNameForImportExcept, rsemCannotExport,
  rsemCannotMixTypesAndValuesInTuple, rsemInvalidBindContext,
  rsemCannotCreateImplicitOpenarray,
  rsemCannotAssignToDiscriminantWithCustomDestructor, rsemUnavailableTypeBound,
  rsemUnavailableLocation, rsemUndeclaredIdentifier, rsemExpectedIdentifier,
  rsemExpectedIdentifierQuoteLimit, rsemExpectedIdentifierInExpr,
  rsemExpectedIdentifierWithExprContext, rsemModuleAliasMustBeIdentifier,
  rsemOnlyDeclaredIdentifierFoundIsError, rsemFieldNotAccessible, ## object field is not accessible
  rsemFieldAssignmentInvalid, ## object field assignment invalid syntax
  rsemFieldAssignmentInvalidNeedSpace, ## object field assignment invalid syntax, need space after colon
  rsemExpressionHasNoType,  ## an expression has not type or is ambiguous
  rsemRawTypeMismatch, rsemCannotConvertTypes, rsemCannotCreateFlowVarOfType,
  rsemTypeNotAllowed, rsemIntLiteralExpected, ## int literal node was expected, but got something else
  rsemStringLiteralExpected, ## string literal node was expected, but got something else
  rsemOnOrOffExpected, rsemCallconvExpected, rsemUnknownExperimental,
  rsemDuplicateCaseLabel, rsemExpressionIsNotAPath, rsemResultMustBorrowFirst,
  rsemCannotDetermineBorrowTarget, rsemCannotBorrow, rsemBorrowOutlivesSource,
  rsemImmutableBorrowMutation, rsemCyclicTree, rsemCyclicDependency,
  rsemConstExprExpected, rsemRttiRequestForIncompleteObject,
  rsemExpectedNimcallProc, rsemExpectedParameterForJsPattern,
  rsemRequiresDeepCopyEnabled, rsemDisallowedOfForPureObjects,
  rsemCannotCodegenCompiletimeProc, rsemInvalidPragma, ## suplied pragma is invalid
  rsemUnexpectedPragma, rsemPropositionExpected, rsemIllegalCustomPragma, ## supplied pragma is not a legal custom pragma, and cannot be attached
  rsemExternalLocalNotAllowed, ## a local is specified to be part of an external interface
  rsemNoReturnHasReturn,    ## a routine marked as no return, has a return type
  rsemImplicitPragmaError, ## a symbol encountered an error when processing implicit pragmas, this
                            ## 
                            ## should be applied to symbols and treated as a wrapper for the purposes
                            ## 
                            ## of reporting. the original symbol is stored as the first argument
  rsemPragmaDynlibRequiresExportc, ## much the same as `ImplicitPragmaError`, except it's a special case
                                    ## where dynlib pragma requires an importc pragma to exist on the same
                                    ## symbol
                                    ## xxx: pragmas shouldn't require each other, that's just bad design
  rsemWrappedError, ## there is no meaningful error to construct, but there is an error
                     ## further down the AST that invalidates the whole
  rsemPragmaDisallowedForTupleUnpacking, ## we disallow pragma blocks `let (foo {.somePragma.}, bar) = (1,2)` as
                                          ## the semantics of pragmas in the face of unpacking are not woefully
                                          ## underspecified. This is not a matter of reenabling it as a rethinking
                                          ## the approach from a first principles perspective is required.
  rsemIllegalCompileTime, ## when used on variables, the ``.compileTime`` pragma must only be
                           ## applied to locals inside compile-time procedures or to globals
  rsemSymbolKindMismatch, rsemIllformedAst, rsemInitHereNotAllowed,
  rsemTypeExpected, rsemSinkIsNotATypeClass, rsemGenericTypeExpected,
  rsemTypeInvalid, rsemWrongIdent, rsemPragmaOptionExpected,
  rsemUnexpectedPushArgument, rsemCannotPushCast, rsemCastRequiresStatement,
  rsemDynlibRequiresExportc, rsemImportjsRequiresJs, rsemBitsizeRequires1248,
  rsemBitsizeRequiresPositive, rsemAlignRequiresPowerOfTwo,
  rsemPragmaRecursiveDependency, rsemMisplacedDeprecation, rsemNoUnionForJs,
  rsemThisPragmaRequires01Args, rsemMismatchedPopPush,
  rsemExcessiveCompilePragmaArgs, rsemLinePragmaExpectsTuple,
  rsemRaisesPragmaExpectsObject, rsemCompilerOptionInvalid,
  rsemCompilerOptionArgInvalid, rsemLocksPragmaExpectsList,
  rsemLocksPragmaBadLevel, rsemLocksRequiresArgs,
  rsemMultilockRequiresSameLevel, rsemInvalidNestedLocking, rsemUnguardedAccess,
  rsemInvalidGuardField, rsemStaticIndexLeqUnprovable,
  rsemStaticIndexGeProvable, rsemErrGcUnsafeListing, rsemBorrowPragmaNonDot,
  rsemInvalidExtern, rsemInvalidPragmaBlock, rsemMisplacedEffectsOf,
  rsemMissingPragmaArg, rsemErrGcUnsafe, rsemEmptyAsm, rsemUserWarning = "User", ## `{.warning: }`
  rsemUnknownMagic = "UnknownMagic", rsemUnusedImport = "UnusedImport",
  rsemDeprecated = "Deprecated", rsemDeprecatedCompilerOpt = "Deprecated",
  rsemDeprecatedCompilerOptArg = "Deprecated",
  rsemLockLevelMismatch = "LockLevel", rsemTypelessParam = "TypelessParam",
  rsemOwnedTypeDeprecated, rsemCodegenDeclDeprecated = "Deprecated", rsemWarnUnlistedRaises = "Effect", ## `sempass2.checkRaisesSpec` had
                                                                                                         ## `emitWarnings: bool` parameter which was supposedly used to control
                                                                                                         ## whether `strictEffects` warnings actually generated an error, or
                                                                                                         ## just a warning. But all four uses of this proc had constant `false`
                                                                                                         ## written to this field, so for now it does not mean anything and all
                                                                                                         ## mismatched raises are routed as errors.
  rsemDotForModuleImport, rsemProveField = "ProveField",
  rsemStrictNotNilExpr = "StrictNotNil",
  rsemStrictNotNilResult = "StrictNotNil", rsemWarnGcUnsafe = "GcUnsafe",
  rsemWarnGcUnsafeListing = "GcUnsafe2", rsemProveInit = "ProveInit",
  rsemUninit = "Uninit", rsemImplicitCstringConvert = "CStringConv",
  rsemHoleEnumConvert = "HoleEnumConv", rsemAnyEnumConvert = "AnyEnumConv",
  rsemMethodLockMismatch, rsemUseBase = "UseBase",
  rsemUnreachableElse = "UnreachableElse",
  rsemUnreachableCode = "UnreachableCode",
  rsemInheritFromException = "InheritFromException", rsemPtrRegionIsDeprecated,
  rsemTypedReturnDeprecated, rsemEachIdentIsTuple = "EachIdentIsTuple",
  rsemResultShadowed = "ResultShadowed", rsemResultUsed = "ResultUsed",
  rsemGenericMethodsDeprecated, rsemSuspiciousEnumConv = "EnumConv",
  rsemUnsafeSetLen = "UnsafeSetLen", rsemUnsafeDefault = "UnsafeDefault",
  rsemUntypedParamsFollwedByMoreSpecificType, rsemBindDeprecated,
  rsemObservableStores = "ObservableStores", rsemUnknownHint = "UnknownHint",
  rsemUnknownWarning = "UnknownWarning", rsemUseOfGc = "GcMem", rsemUserHint = "User", ## `{.hint: .}` pragma encountereed
  rsemLinterReport = "Name", rsemLinterReportUse = "Name",
  rsemHintLibDependency = "Dependency",
  rsemXDeclaredButNotUsed = "XDeclaredButNotUsed",
  rsemDuplicateModuleImport = "DuplicateModuleImport",
  rsemXCannotRaiseY = "XCannotRaiseY",
  rsemConvToBaseNotNeeded = "ConvToBaseNotNeeded",
  rsemConvFromXtoItselfNotNeeded = "ConvFromXtoItselfNotNeeded",
  rsemClosureWithoutEnv = "ClosureWithoutEnv", rsemProcessing = "Processing", ## Processing module
  rsemProcessingStmt = "ProcessingStmt", ## Processing toplevel statement
  rsemExprAlwaysX = "ExprAlwaysX", ## Expression always evaluates to "X"
  rsemConditionAlwaysTrue = "CondTrue", ## Condition is always true
  rsemConditionAlwaysFalse = "CondFalse", ## Condition is always false
  rsemPattern = "Pattern",  ## Term rewriting pattern has been triggered
  rsemCannotMakeSink,       ## Argument could not be turned into a sink
                             ## parameter. Generated once in the whole compiler
                             ## `sinkparameter_inference.nim`
  rsemCopiesToSink,         ## Passing data to the `sink` parameter still copies
                             ## due to control flow in the code
  rsemGlobalVar = "GlobalVar", ## Track global variable declarations?
  rsemEffectsListingHint, rsemExpandMacro = "ExpandMacro", ## Trace macro expansion progress
  rsemCompilesReport, rsemNonMatchingCandidates, rsemExtendedContext = "ExtendedContext", ## Extended contextual
                                                                                           ## information. Used in `ccgstmts.genStmts()` and
                                                                                           ## `semexprs.semExprNoType()`
  rsemDiagnostics, rsemImplicitObjConv = "ImplicitObjConv", rcmdFailedExecution,
  rcmdCompiling = "CC", rcmdLinking = "Link", rcmdExecuting = "Exec",
  rcmdRunnableExamplesSuccess = "Success", rdbgVmExecTraceFull,
  rdbgVmExecTraceMinimal, rdbgOptionsPush, rdbgOptionsPop, rbackCannotWriteScript, ## Cannot write build script to a cache file
  rbackCannotWriteMappingFile, ## Cannot write module compilation mapping
                                ## file to cache directory
  rbackTargetNotSupported,  ## C compiler does not support requested target
  rbackJsTooCaseTooLarge, rbackJsonScriptMismatch, rbackVmFileWriteFailed,
  rbackRstCannotOpenFile, rbackRstExpected, rbackRstGridTableNotImplemented,
  rbackRstMarkdownIllformedTable, rbackRstNewSectionExpected,
  rbackRstGeneralParseError, rbackRstInvalidDirective, rbackRstInvalidField,
  rbackRstFootnoteMismatch, rbackCannotProduceAssembly, rbackRstTestUnsupported,
  rbackRstRedefinitionOfLabel = "RedefinitionOfLabel",
  rbackRstUnknownSubstitution = "UnknownSubstitutionX",
  rbackRstBrokenLink = "BrokenLink",
  rbackRstUnsupportedLanguage = "LanguageXNotSupported",
  rbackRstUnsupportedField = "FieldXNotSupported",
  rbackRstRstStyle = "warnRstStyle", rbackProducedAssembly,
  rbackCompiling = "Compiling", rbackLinking = "Link"

Toplevel enum for different categories. Order of definitions is really important - elements are first separated into categories (internal reports, backend reports and so on) and can be further split into severity levels.

Different naming scheme is used for a reports with different categories - this enum exists only to make it easier to work with different report kinds, without having to manage seven different enum types.

  Source   Edit
ReportSeverity = enum
  rsevDebug = "Debug",      ## Internal compiler debug information
  rsevHint = "Hint",        ## User-targeted hint
  rsevWarning = "Warning",  ## User-targeted warnings
  rsevError = "Error",      ## User-targeted error
  rsevFatal = "Fatal", rsevTrace = "Trace" ## Additional information about compiler actions -
                                           ## external commands mostly.
  Source   Edit
SemOrVMReportKind = range[low(VMReportKind) .. high(SemReportKind)]
  Source   Edit
SemReportErrorKind = range[rsemUserError .. rsemWrappedError]
  Source   Edit
SemReportKind = range[rsemFatalError .. rsemImplicitObjConv]
  Source   Edit
VMReportKind = range[rvmOpcParseExpectedExpression .. rvmStackTrace]
  Source   Edit

Consts

rbackErrorKinds = {rbackCannotWriteScript..rbackCannotProduceAssembly}
  Source   Edit
rbackHintKinds = {rbackProducedAssembly..rbackLinking}
  Source   Edit
rbackWarningKinds = {rbackRstTestUnsupported..rbackRstRstStyle}
  Source   Edit
rcmdErrorKinds = {rcmdFailedExecution}
  Source   Edit
rcmdHintKinds = {rcmdCompiling..rcmdRunnableExamplesSuccess}
  Source   Edit
repAllKinds = {repNone..rbackLinking}
  Source   Edit
repBackendKinds = {rbackCannotWriteScript..rbackLinking}
  Source   Edit
repCmdKinds = {rcmdFailedExecution..rcmdRunnableExamplesSuccess}
  Source   Edit
repDataPassKinds: ReportKinds = {rintStackTrace..rintEchoMessage}
  Source   Edit
repDebugKinds = {rdbgVmExecTraceFull..rdbgOptionsPop}
  Source   Edit
repErrorKinds: ReportKinds = {rintCannotOpenFile..rintNotImplemented,
                              rextCmdRequiresFile,
                              rlexMalformedNumUnderscores..rlexUnclosedComment,
                              rparInvalidIndentation..rparInvalidFilter, rvmOpcParseExpectedExpression..rvmTooManyIterations,
                              rsemUserError..rsemEmptyAsm, rcmdFailedExecution, rbackCannotWriteScript..rbackCannotProduceAssembly}
  Source   Edit
repExternalKinds = {rextCmdRequiresFile..rextPath}
  Source   Edit
repFatalKinds: ReportKinds = {rintUnreachable..rintAssert, rsemFatalError}
  Source   Edit
repHintGroups = [("all", {rintSource..rintSuccessX, rextConf..rextPath,
                          rlexLineTooLong..rlexSourceCodeFilterOutput,
                          rsemUserHint..rsemImplicitObjConv,
                          rcmdCompiling..rcmdRunnableExamplesSuccess,
                          rbackProducedAssembly..rbackLinking}),
                 ("Performance", {rsemCopiesToSink, rsemCannotMakeSink}), (
    "Name", {rlexLinterReport, rsemLinterReport, rsemLinterReportUse}),
                 ("Link", {rbackLinking, rcmdLinking})]
  Source   Edit
repHintKinds: ReportKinds = {rintSource..rintSuccessX, rextConf..rextPath,
                             rlexLineTooLong..rlexSourceCodeFilterOutput,
                             rsemUserHint..rsemImplicitObjConv,
                             rcmdCompiling..rcmdRunnableExamplesSuccess,
                             rbackProducedAssembly..rbackLinking}
  Source   Edit
repInternalKinds: ReportKinds = {rintUnreachable..rintEchoMessage}
  Source   Edit
repLexerKinds = {rlexMalformedNumUnderscores..rlexSourceCodeFilterOutput}
  Source   Edit
repLinkingHints = {rbackLinking, rcmdLinking}
  Source   Edit
repLinterKinds = {rlexLinterReport, rsemLinterReport, rsemLinterReportUse}
  Source   Edit
repNilcheckKinds = {rsemStrictNotNilExpr, rsemStrictNotNilResult}
  Source   Edit
repParserKinds = {rparInvalidIndentation..rparEnablePreviewDotOps}
  Source   Edit
repPerformanceHints = {rsemCopiesToSink, rsemCannotMakeSink}
  Source   Edit
repSemKinds = {rsemFatalError..rsemImplicitObjConv}
  Source   Edit
repStrictNotNilWarnings = {rsemStrictNotNilExpr, rsemStrictNotNilResult}
  Source   Edit
repTraceKinds: ReportKinds = {rintStackTrace, rvmStackTrace,
                              rdbgVmExecTraceFull..rdbgOptionsPop}
  Source   Edit
repVMKinds = {rvmOpcParseExpectedExpression..rvmStackTrace}
  Source   Edit
repWarningGroups = [("all", {rintWarnCannotOpenFile..rintWarnFileChanged,
                             rlexDeprecatedOctalPrefix,
                             rparInconsistentSpacing..rparEnablePreviewDotOps,
                             rsemUserWarning..rsemUseOfGc,
                             rbackRstTestUnsupported..rbackRstRstStyle}), (
    "StrictNotNil", {rsemStrictNotNilExpr, rsemStrictNotNilResult})]
  Source   Edit
repWarningKinds: ReportKinds = {rintWarnCannotOpenFile..rintWarnFileChanged,
                                rlexDeprecatedOctalPrefix, rparInconsistentSpacing..rparEnablePreviewDotOps,
                                rsemUserWarning..rsemUseOfGc,
                                rbackRstTestUnsupported..rbackRstRstStyle}
  Source   Edit
rextErrorKinds = {rextCmdRequiresFile..rextCmdRequiresFile}
  Source   Edit
rextHintKinds = {rextConf..rextPath}
  Source   Edit
rintDataPassKinds = {rintStackTrace..rintEchoMessage}
  Source   Edit
rintErrorKinds = {rintCannotOpenFile..rintNotImplemented}
  Source   Edit
rintFatalKinds = {rintUnreachable..rintAssert}
Fatal internal compilation reports   Source   Edit
rintHintKinds = {rintSource..rintSuccessX}
  Source   Edit
rintWarningKinds = {rintWarnCannotOpenFile..rintWarnFileChanged}
  Source   Edit
rlexErrorKinds = {rlexMalformedNumUnderscores..rlexUnclosedComment}
  Source   Edit
rlexHintKinds = {rlexLineTooLong..rlexSourceCodeFilterOutput}
  Source   Edit
rlexWarningKinds = {rlexDeprecatedOctalPrefix..rlexDeprecatedOctalPrefix}
  Source   Edit
rparErrorKinds = {rparInvalidIndentation..rparInvalidFilter}
  Source   Edit
rparHintKinds = {}
  Source   Edit
rparWarningKinds = {rparInconsistentSpacing..rparEnablePreviewDotOps}
  Source   Edit
rsemErrorKinds = {rsemUserError..rsemEmptyAsm}
  Source   Edit
rsemHintKinds = {rsemUserHint..rsemImplicitObjConv}
  Source   Edit
rsemReportBigOrdsEnergy = {rsemSetTooBig, rsemArrayExpectsPositiveRange,
                           rsemInvalidOrderInEnum}
My Big Ords need some Big Ints   Source   Edit
rsemReportCountMismatch = {rsemWrongNumberOfArguments,
                           rsemWrongNumberOfGenericParams,
                           rsemInvalidOrderInArrayConstructor,
                           rsemTypeConversionArgumentMismatch,
                           rsemInvalidTupleSubscript,
                           rsemExpectedTemplateWithNArgs,
                           rsemWrongNumberOfQuoteArguments, rsemIndexOutOfBounds}
  Source   Edit
rsemReportListSym = {rsemAmbiguous, rsemAmbiguousIdentWithCandidates,
                     rsemObjectRequiresFieldInit,
                     rsemObjectRequiresFieldInitNoDefault}
  Source   Edit
rsemReportOneSym = {rsemDoubleCompletionOf, rsemOverrideSafetyMismatch,
                    rsemOverrideLockMismatch}
  Source   Edit
rsemReportTwoSym = {rsemConflictingExportnims, rsemBorrowOutlivesSource,
                    rsemImmutableBorrowMutation, rsemRedefinitionOf,
                    rsemInvalidMethodDeclarationOrder,
                    rsemIllegalCallconvCapture, rsemDeprecated,
                    rsemUnexpectedPragmaInDefinitionOf}
  Source   Edit
rsemWarningKinds = {rsemUserWarning..rsemUseOfGc}
  Source   Edit
rstWarnings = {rbackRstTestUnsupported..rbackRstRstStyle}
  Source   Edit
rvmErrorKinds = {rvmOpcParseExpectedExpression..rvmTooManyIterations}
  Source   Edit
rvmHintKinds = {}
  Source   Edit
rvmTraceKinds = {rvmStackTrace}
  Source   Edit
rvmWarningKinds = {}
  Source   Edit