compiler/front/msgs

    Dark Mode
Search:
  Source   Edit

Consts

ColOffset = 1
  Source   Edit
gCmdLineInfo = (line: 1'u16, col: 1'i16, fileIndex: -3'i32)
  Source   Edit

Procs

proc `$`(conf: ConfigRef; info: TLineInfo): string {....raises: [], tags: [].}
  Source   Edit
proc `$`(info: TLineInfo): string {.error.}
  Source   Edit
func astDiagToLegacyReportKind(diag: AstDiagKind; vmGenDiag: Option[
    AstDiagVmGenKind] = none(AstDiagVmGenKind); vmEvent: Option[AstDiagVmKind] = none(
    AstDiagVmKind)): ReportKind {.inline, ...raises: [], tags: [].}
  Source   Edit
func astDiagToLegacyReportKind(diag: PAstDiag): ReportKind {.inline, ...raises: [],
    tags: [].}
  Source   Edit
func astDiagVmGenToLegacyReportKind(diag: AstDiagVmGenKind): ReportKind {.
    inline, ...raises: [], tags: [].}
  Source   Edit
func astDiagVmToLegacyReportKind(evt: AstDiagVmKind): ReportKind {.inline,
    ...raises: [], tags: [].}
  Source   Edit
proc defaultDiagHandler(conf: ConfigRef; rep: sink Report) {.
    ...raises: [Exception], tags: [RootEffect].}
Handles the report/diagnostic by sending it to the display/render hook, but only if the report is "enabled" according to the current configuration. Depending on the configuration, the program may be terminated.   Source   Edit
proc doInternalAssert(conf: ConfigRef; instLoc: InstantiationInfo; msg: string;
                      info = unknownLineInfo) {.noreturn, inline,
    ...raises: [Exception], tags: [RootEffect].}
this proc firewalls other code from legacy reports, used in conjunction with the internalAssert templates   Source   Edit
proc doInternalUnreachable(conf: ConfigRef; info: TLineInfo; msg: string;
                           instLoc: InstantiationInfo) {.noreturn, inline,
    ...raises: [Exception], tags: [RootEffect].}
this proc firewalls other code from legacy reports, used in conjunction with the internalError templates   Source   Edit
proc emit(config: ConfigRef; report: sink Report; at: InstantiationInfo) {.
    inline, ...raises: [Exception], tags: [RootEffect].}
Emits the diagnostic represented by report, with at being the compiler source location to which the report should point to. This is a fire-and- forget operation; the callsite has to assume emit returns normally.   Source   Edit
proc flushDot(conf: ConfigRef) {....raises: [IOError], tags: [WriteIOEffect].}
safe to call multiple times   Source   Edit
proc formatPath(conf: ConfigRef; path: string): string {....raises: [KeyError],
    tags: [].}
Format absolute file path for error message reporting. If path is not registered in the filenameToIndexTbl and is not a path to the compiler source, return it unchanged. If configuration is nil also return path unchanged.   Source   Edit
proc getContext(conf: ConfigRef; lastinfo: TLineInfo): seq[ReportContext] {.
    ...raises: [], tags: [].}
Get list of context context entries from the current message context information. Context messages can later be used in the SemReport.context field   Source   Edit
proc getHash(conf: ConfigRef; fileIdx: FileIndex): string {....raises: [], tags: [].}
  Source   Edit
proc getInfoContext(conf: ConfigRef; index: int): TLineInfo {....raises: [],
    tags: [].}
  Source   Edit
proc getInfoContextLen(conf: ConfigRef): int {....raises: [], tags: [].}
  Source   Edit
proc getSurroundingSrc(conf: ConfigRef; info: TLineInfo): string {....raises: [],
    tags: [ReadIOEffect].}
  Source   Edit
proc handleLexerDiag(conf: ConfigRef; diag: LexerDiag;
                     reportFrom: InstantiationInfo; isFatal = false) {.inline,
    ...raises: [ValueError, Exception], tags: [RootEffect].}
  Source   Edit
proc handleParserDiag(conf: ConfigRef; diag: ParseDiag;
                      reportFrom: InstantiationInfo) {.inline,
    ...raises: [Exception], tags: [RootEffect].}
  Source   Edit
proc joinAnyOf[T](values: seq[T]; quote: bool = false): string
  Source   Edit
func lexDiagToLegacyReportKind(diag: LexerDiagKind): ReportKind {.inline,
    ...raises: [], tags: [].}
  Source   Edit
func lexerDiagToLegacyReport(diag: LexerDiag): Report {.inline,
    ...raises: [ValueError], tags: [].}
  Source   Edit
proc listHints(conf: ConfigRef) {....raises: [Exception], tags: [RootEffect].}
  Source   Edit
proc listWarnings(conf: ConfigRef) {....raises: [Exception], tags: [RootEffect].}
  Source   Edit
proc msgQuit(x: int8) {....raises: [], tags: [].}
  Source   Edit
proc msgQuit(x: string) {....raises: [], tags: [].}
  Source   Edit
proc msgWrite(conf: ConfigRef; s: string; flags: MsgFlags = {}) {.
    ...raises: [IOError], tags: [WriteIOEffect].}

Writes given message string to stderr by default. If --stdout option is given, writes to stdout instead. If message hook is present, then it is used to output message rather than stderr/stdout. This behavior can be altered by given optional flags.

This is used for 'nim dump' etc. where we don't have nimsuggest support.

This procedure is used as a default implementation of the ConfigRef.writeHook.

  Source   Edit
proc numLines(conf: ConfigRef; fileIdx: FileIndex): int {....raises: [],
    tags: [ReadIOEffect].}
xxx there's an off by 1 error that should be fixed; if a file ends with "foo" or "foon" it will return same number of lines (ie, a trailing empty line is discounted)   Source   Edit
proc popInfoContext(conf: ConfigRef) {....raises: [], tags: [].}
Remove one entry from the message context information stack   Source   Edit
proc pushInfoContext(conf: ConfigRef; info: TLineInfo; detail: PSym = nil) {.
    ...raises: [], tags: [].}
Add entry to the message context information stack.   Source   Edit
proc quotedFilename(conf: ConfigRef; i: TLineInfo): Rope {....raises: [], tags: [].}
  Source   Edit
proc semReportCountMismatch(kind: ReportKind;
                            expected, got: distinct SomeInteger;
                            node: PNode = nil): SemReport
  Source   Edit
proc setDirtyFile(conf: ConfigRef; fileIdx: FileIndex; filename: AbsoluteFile) {.
    ...raises: [], tags: [].}
  Source   Edit
proc setHash(conf: ConfigRef; fileIdx: FileIndex; hash: string) {....raises: [],
    tags: [].}
  Source   Edit
proc setInfoContextLen(conf: ConfigRef; L: int) {....raises: [], tags: [].}
  Source   Edit
proc sourceLine(conf: ConfigRef; i: TLineInfo): string {....raises: [],
    tags: [ReadIOEffect].}
1-based index (matches editor line numbers); 1st line is for i.line = 1 last valid line is numLines inclusive   Source   Edit
proc suggestQuit() {....raises: [ESuggestDone], tags: [].}
  Source   Edit
proc temporaryStringError(conf: ConfigRef; info: TLineInfo; text: string) {.
    ...raises: [], tags: [].}
  Source   Edit
proc toColumn(info: TLineInfo): int {.inline, ...raises: [], tags: [].}
  Source   Edit
proc toFileLineCol(conf: ConfigRef; info: TLineInfo): string {.inline,
    ...raises: [], tags: [].}
Construct file(line, col) string from report location information   Source   Edit
proc toFileLineCol(info: InstantiationInfo): string {.inline, ...raises: [],
    tags: [].}
  Source   Edit
proc toFilenameOption(conf: ConfigRef; fileIdx: FileIndex; opt: FilenameOption): string {.
    ...raises: [], tags: [].}
  Source   Edit
proc toFullPath(conf: ConfigRef; fileIdx: FileIndex): string {....raises: [],
    tags: [].}
  Source   Edit
proc toFullPathConsiderDirty(conf: ConfigRef; fileIdx: FileIndex): AbsoluteFile {.
    ...raises: [], tags: [].}
  Source   Edit
proc toLinenumber(info: TLineInfo): int {.inline, ...raises: [], tags: [].}
  Source   Edit
proc toMsgFilename(conf: ConfigRef; fileIdx: FileIndex): string {....raises: [],
    tags: [].}
  Source   Edit
proc toProjPath(conf: ConfigRef; fileIdx: FileIndex): string {....raises: [],
    tags: [].}
  Source   Edit
proc toReportLineInfo(conf: ConfigRef; info: TLineInfo): ReportLineInfo {.
    ...raises: [], tags: [].}
  Source   Edit
proc toReportPoint(conf: ConfigRef; info: TLineInfo): ReportLineInfo {.inline,
    ...raises: [], tags: [].}
Construct report location instance based on the information from info   Source   Edit
proc uniqueModuleName(conf: ConfigRef; fid: FileIndex): string {.
    ...raises: [Exception], tags: [RootEffect].}
The unique module name is guaranteed to only contain {'A'..'Z', 'a'..'z', '0'..'9', '_'} so that it is useful as a C identifier snippet.   Source   Edit
proc unquotedFilename(conf: ConfigRef; i: TLineInfo): Rope {....raises: [],
    tags: [].}
Returns the unqouted filename for i, for the purpose of being used for run-time stacktraces.   Source   Edit

Templates

template createSemIllformedAstMsg(node: PNode; expected: set[TNodeKind]): string
  Source   Edit
template fatalReport(conf: ConfigRef; info: TLineInfo; rep: ReportTypes)
  Source   Edit
template globalReport(conf: ConfigRef; info: TLineInfo; report: ReportTypes)
Emits the report and yields control to the closest fatal error handler. Control is never passed back to the current continuation.   Source   Edit
template globalReport(conf: ConfigRef; report: ReportTypes)
Emits the report and yields control to the closest fatal error handler. Control is never passed back to the current continuation.   Source   Edit
template internalAssert(conf: ConfigRef; condition: bool; failMsg = "")
Causes an internal error if the provided condition evaluates to false. Always ends the currently executing routine.   Source   Edit
template internalAssert(conf: ConfigRef; condition: bool; info: TLineInfo;
                        failMsg: string = "")
Causes an internal error if the provided condition evaluates to false. Always ends the currently executing routine.   Source   Edit
template internalError(conf: ConfigRef; fail: string): untyped
Causes an internal error. Always ends the currently executing routine.   Source   Edit
template internalError(conf: ConfigRef; info: TLineInfo; fail: string): untyped
Causes an internal error. Always ends the currently executing routine.   Source   Edit
template localReport(conf: ConfigRef; info: TLineInfo; report: ReportTypes)
  Source   Edit
template localReport(conf: ConfigRef; info: TLineInfo; report: ReportTypes)
  Source   Edit
template localReport(conf: ConfigRef; node: PNode; report: SemReport)
  Source   Edit
template localReport(conf: ConfigRef; report: Report)
  Source   Edit
template localReport(conf: ConfigRef; report: ReportTypes)
  Source   Edit
template semReportIllformedAst(conf: ConfigRef; node: PNode;
                               expected: set[TNodeKind]): untyped
  Source   Edit
template semReportIllformedAst(conf: ConfigRef; node: PNode; explain: string): untyped
  Source   Edit
template toFullPath(conf: ConfigRef; info: TLineInfo): string
  Source   Edit
template toFullPathConsiderDirty(conf: ConfigRef; info: TLineInfo): string
  Source   Edit
template toMsgFilename(conf: ConfigRef; info: TLineInfo): string
  Source   Edit
template toProjPath(conf: ConfigRef; info: TLineInfo): string
  Source   Edit