Skip to content

Commit c1cbf94

Browse files
timotheecourAraq
authored andcommitted
remove isCmdLine; use passCmd1
1 parent ce36fdc commit c1cbf94

File tree

4 files changed

+3
-7
lines changed

4 files changed

+3
-7
lines changed

compiler/cmdlinehelper.nim

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ proc initDefinesProg*(self: NimProg, conf: ConfigRef, name: string) =
2727
defineSymbol conf.symbols, name
2828

2929
proc processCmdLineAndProjectPath*(self: NimProg, conf: ConfigRef) =
30-
conf.isCmdLine = true
3130
self.processCmdLine(passCmd1, "", conf)
32-
conf.isCmdLine = false
3331
if self.supportsStdinFile and conf.projectName == "-":
3432
handleStdinInput(conf)
3533
elif conf.projectName != "":

compiler/commands.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,15 +204,15 @@ proc processSpecificNote*(arg: string, state: TSpecialWord, pass: TCmdLinePass,
204204
incl(conf.notes, n)
205205
incl(conf.mainPackageNotes, n)
206206
incl(conf.enableNotes, n)
207-
if conf.isCmdLine:
207+
if pass == passCmd1:
208208
incl(conf.cmdLineNotes, n)
209209
excl(conf.cmdLineDisabledNotes, n)
210210
of "off":
211211
excl(conf.notes, n)
212212
excl(conf.mainPackageNotes, n)
213213
incl(conf.disableNotes, n)
214214
excl(conf.foreignPackageNotes, n)
215-
if conf.isCmdLine:
215+
if pass == passCmd1:
216216
incl(conf.cmdLineDisabledNotes, n)
217217
excl(conf.cmdLineNotes, n)
218218
else: localError(conf, info, errOnOrOffExpectedButXFound % arg)

compiler/msgs.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ proc rawMessage*(conf: ConfigRef; msg: TMsgKind, args: openArray[string]) =
421421
if msg in conf.cmdLineDisabledNotes: return # eg: `--hints:conf:off` passed on cmdline
422422
# handle `--hints:off` (regardless of cmdline/cfg file)
423423
# handle `--hints:conf:on` on cmdline
424-
if not conf.hasHint(msg) and not (optHints in conf.options and msg in conf.cmdLineNotes)): return
424+
if not conf.hasHint(msg) and not (optHints in conf.options and msg in conf.cmdLineNotes): return
425425
title = HintTitle
426426
color = HintColor
427427
if msg != hintUserRaw: kind = HintsToStr[ord(msg) - ord(hintMin)]

compiler/options.nim

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,6 @@ type
288288
structuredErrorHook*: proc (config: ConfigRef; info: TLineInfo; msg: string;
289289
severity: Severity) {.closure, gcsafe.}
290290
cppCustomNamespace*: string
291-
isCmdLine*: bool # whether we are currently processing cmdline args, not cfg files
292291

293292
proc hasHint*(conf: ConfigRef, note: TNoteKind): bool =
294293
optHints in conf.options and note in conf.notes
@@ -394,7 +393,6 @@ proc newConfigRef*(): ConfigRef =
394393
arguments: "",
395394
suggestMaxResults: 10_000,
396395
maxLoopIterationsVM: 10_000_000,
397-
isCmdLine: false,
398396
)
399397
setTargetFromSystem(result.target)
400398
# enable colors by default on terminals

0 commit comments

Comments
 (0)