diff --git a/compiler/main.nim b/compiler/main.nim index 3404adf14c58f..e573f77cb5b10 100644 --- a/compiler/main.nim +++ b/compiler/main.nim @@ -234,7 +234,7 @@ proc mainCommand*(graph: ModuleGraph) = defineSymbol(conf.symbols, "nimdoc") commandDoc2(graph, false) of "rst2html": - conf.setNoteDefaults(warnRedefinitionOfLabel, false) # issue #13218 + conf.setNoteDefaults(warnRedefinitionOfLabel, false) # similar to issue #13218 when defined(leanCompiler): quit "compiler wasn't built with documentation generator" else: diff --git a/compiler/options.nim b/compiler/options.nim index 41d0ae59e3677..78d04f1072f2c 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -229,7 +229,7 @@ type modifiedyNotes*: TNoteKinds # notes that have been set/unset from either cmdline/configs cmdlineNotes*: TNoteKinds # notes that have been set/unset from cmdline foreignPackageNotes*: TNoteKinds - notesImpl*: TNoteKinds # notes after resolving all logic(defaults, verbosity)/cmdline/configs + notes*: TNoteKinds # notes after resolving all logic(defaults, verbosity)/cmdline/configs mainPackageNotes*: TNoteKinds mainPackageId*: int errorCounter*: int @@ -287,26 +287,6 @@ type severity: Severity) {.closure, gcsafe.} cppCustomNamespace*: string -# proc notesImpl -var first = true -template fun(conf) = - if warnLockLevel notin conf.notesImpl: - first = true - elif first: - first = false - if warnLockLevel in conf.notesImpl: - # echo0b getStackTrace() - discard - -template `notes`*(a: ConfigRef): untyped = - fun(a) - a.notesImpl - -template `notes=`*(a: ConfigRef, val) = - fun(a) - a.notesImpl = val - fun(a) - proc setNoteDefaults*(conf: ConfigRef, note: TNoteKind, enabled = true) = template fun(op) = conf.notes.op note @@ -318,7 +298,6 @@ proc setNote*(conf: ConfigRef, note: TNoteKind, enabled = true) = # see also `prepareConfigNotes` which sets notes if note notin conf.cmdlineNotes: if enabled: incl(conf.notes, note) else: excl(conf.notes, note) - fun(conf) proc hasHint*(conf: ConfigRef, note: TNoteKind): bool = optHints in conf.options and note in conf.notes @@ -385,8 +364,7 @@ proc newConfigRef*(): ConfigRef = cppDefines: initHashSet[string](), headerFile: "", features: {}, legacyFeatures: {}, foreignPackageNotes: {hintProcessing, warnUnknownMagic, hintQuitCalled, hintExecuting}, - # notes: NotesVerbosity[1], mainPackageNotes: NotesVerbosity[1], - notesImpl: NotesVerbosity[1], mainPackageNotes: NotesVerbosity[1], + notes: NotesVerbosity[1], mainPackageNotes: NotesVerbosity[1], configVars: newStringTable(modeStyleInsensitive), symbols: newStringTable(modeStyleInsensitive), packageCache: newPackageCache(), @@ -440,8 +418,7 @@ proc newPartialConfigRef*(): ConfigRef = globalOptions: DefaultGlobalOptions, foreignPackageNotes: {hintProcessing, warnUnknownMagic, hintQuitCalled, hintExecuting}, - # notes: NotesVerbosity[1], mainPackageNotes: NotesVerbosity[1]) - notesImpl: NotesVerbosity[1], mainPackageNotes: NotesVerbosity[1]) + notes: NotesVerbosity[1], mainPackageNotes: NotesVerbosity[1]) proc cppDefine*(c: ConfigRef; define: string) = c.cppDefines.incl define