From e84354666ac141959104f50be3fb22f1932dbaf4 Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Sat, 26 Dec 2020 14:28:56 -0800 Subject: [PATCH] fix #16346 rst2html now honors SuccessX (#16347) * fix #16346 SuccessX rst2html * cleanups * _ * _ * _ --- compiler/commands.nim | 7 +++++++ compiler/options.nim | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/compiler/commands.nim b/compiler/commands.nim index 11bf628b42..4b8755ab48 100644 --- a/compiler/commands.nim +++ b/compiler/commands.nim @@ -439,6 +439,13 @@ proc setCmd*(conf: ConfigRef, cmd: Command) = proc setCommandEarly*(conf: ConfigRef, command: string) = conf.command = command setCmd(conf, command.parseCommand) + # command early customizations + # must be handled here to honor subsequent `--hint:x:on|off` + case conf.cmd + of cmdRst2html, cmdRst2tex: # xxx see whether to add others: cmdGendepend, etc. + conf.foreignPackageNotes = {hintSuccessX} + else: + conf.foreignPackageNotes = foreignPackageNotesDefault proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo; conf: ConfigRef) = diff --git a/compiler/options.nim b/compiler/options.nim index 73c4c627df..a5f262f012 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -424,6 +424,8 @@ template newPackageCache*(): untyped = proc newProfileData(): ProfileData = ProfileData(data: newTable[TLineInfo, ProfileInfo]()) +const foreignPackageNotesDefault* = {hintProcessing, warnUnknownMagic, hintQuitCalled, hintExecuting} + proc newConfigRef*(): ConfigRef = result = ConfigRef( selectedGC: gcRefc, @@ -435,8 +437,7 @@ proc newConfigRef*(): ConfigRef = arcToExpand: newStringTable(modeStyleInsensitive), m: initMsgConfig(), cppDefines: initHashSet[string](), - headerFile: "", features: {}, legacyFeatures: {}, foreignPackageNotes: {hintProcessing, warnUnknownMagic, - hintQuitCalled, hintExecuting}, + headerFile: "", features: {}, legacyFeatures: {}, foreignPackageNotes: foreignPackageNotesDefault, notes: NotesVerbosity[1], mainPackageNotes: NotesVerbosity[1], configVars: newStringTable(modeStyleInsensitive), symbols: newStringTable(modeStyleInsensitive), @@ -490,8 +491,7 @@ proc newPartialConfigRef*(): ConfigRef = verbosity: 1, options: DefaultOptions, globalOptions: DefaultGlobalOptions, - foreignPackageNotes: {hintProcessing, warnUnknownMagic, - hintQuitCalled, hintExecuting}, + foreignPackageNotes: foreignPackageNotesDefault, notes: NotesVerbosity[1], mainPackageNotes: NotesVerbosity[1]) proc cppDefine*(c: ConfigRef; define: string) =