Skip to content

Commit

Permalink
remove isCmdLine; use passCmd1
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Feb 26, 2020
1 parent 8a3eb98 commit cd4f6de
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 0 additions & 2 deletions compiler/cmdlinehelper.nim
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ proc initDefinesProg*(self: NimProg, conf: ConfigRef, name: string) =
defineSymbol conf.symbols, name

proc processCmdLineAndProjectPath*(self: NimProg, conf: ConfigRef) =
conf.isCmdLine = true
self.processCmdLine(passCmd1, "", conf)
conf.isCmdLine = false
if self.supportsStdinFile and conf.projectName == "-":
handleStdinInput(conf)
elif conf.projectName != "":
Expand Down
4 changes: 2 additions & 2 deletions compiler/commands.nim
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,15 @@ proc processSpecificNote*(arg: string, state: TSpecialWord, pass: TCmdLinePass,
incl(conf.notes, n)
incl(conf.mainPackageNotes, n)
incl(conf.enableNotes, n)
if conf.isCmdLine:
if pass == passCmd1:
incl(conf.cmdLineNotes, n)
excl(conf.cmdLineDisabledNotes, n)
of "off":
excl(conf.notes, n)
excl(conf.mainPackageNotes, n)
incl(conf.disableNotes, n)
excl(conf.foreignPackageNotes, n)
if conf.isCmdLine:
if pass == passCmd1:
incl(conf.cmdLineDisabledNotes, n)
excl(conf.cmdLineNotes, n)
else: localError(conf, info, errOnOrOffExpectedButXFound % arg)
Expand Down
2 changes: 0 additions & 2 deletions compiler/options.nim
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ type
structuredErrorHook*: proc (config: ConfigRef; info: TLineInfo; msg: string;
severity: Severity) {.closure, gcsafe.}
cppCustomNamespace*: string
isCmdLine*: bool # whether we are currently processing cmdline args, not cfg files

proc hasHint*(conf: ConfigRef, note: TNoteKind): bool =
optHints in conf.options and note in conf.notes
Expand Down Expand Up @@ -394,7 +393,6 @@ proc newConfigRef*(): ConfigRef =
arguments: "",
suggestMaxResults: 10_000,
maxLoopIterationsVM: 10_000_000,
isCmdLine: false,
)
setTargetFromSystem(result.target)
# enable colors by default on terminals
Expand Down

0 comments on commit cd4f6de

Please sign in to comment.