diff options
-rw-r--r-- | compiler/nimfix.nim | 3 | ||||
-rw-r--r-- | tools/nimgrep.nim | 16 |
2 files changed, 11 insertions, 8 deletions
diff --git a/compiler/nimfix.nim b/compiler/nimfix.nim index 60ebb48e5..ffab2717a 100644 --- a/compiler/nimfix.nim +++ b/compiler/nimfix.nim @@ -98,6 +98,9 @@ proc handleCmdLine() = processCmdLine(passCmd2, "") mainCommand() +when compileOption("gc", "v2") or compileOption("gc", "refc"): + GC_disableMarkAndSweep() + condsyms.initDefines() defineSymbol "nimfix" handleCmdline() diff --git a/tools/nimgrep.nim b/tools/nimgrep.nim index 7f9910f78..42db2dafc 100644 --- a/tools/nimgrep.nim +++ b/tools/nimgrep.nim @@ -12,7 +12,7 @@ import const Version = "0.9" - Usage = "nimgrep - Nim Grep Utility Version " & version & """ + Usage = "nimgrep - Nim Grep Utility Version " & Version & """ (c) 2012 Andreas Rumpf Usage: @@ -58,7 +58,7 @@ proc ask(msg: string): string = stdout.write(msg) result = stdin.readLine() -proc Confirm: TConfirmEnum = +proc confirm: TConfirmEnum = while true: case normalize(ask(" [a]bort; [y]es, a[l]l, [n]o, non[e]: ")) of "a", "abort": return ceAbort @@ -81,20 +81,20 @@ proc countLines(s: string, first, last: int): int = proc beforePattern(s: string, first: int): int = result = first-1 while result >= 0: - if s[result] in newlines: break + if s[result] in Newlines: break dec(result) inc(result) proc afterPattern(s: string, last: int): int = result = last+1 while result < s.len: - if s[result] in newlines: break + if s[result] in Newlines: break inc(result) dec(result) proc writeColored(s: string) = if useWriteStyled: - terminal.WriteStyled(s, {styleUnderscore, styleBright}) + terminal.writeStyled(s, {styleUnderscore, styleBright}) else: stdout.write(s) @@ -171,7 +171,7 @@ proc processFile(filename: string) = r = replace(wholeMatch, rep, replacement % matches) if optConfirm in options: highlight(buffer, wholeMatch, r, t, line, showRepl=true) - case Confirm() + case confirm() of ceAbort: quit(0) of ceYes: reallyReplace = true of ceAll: @@ -234,8 +234,8 @@ proc styleInsensitive(s: string): string = while s[i] != '>' and s[i] != '\0': addx() of '\\': addx() - if s[i] in strutils.digits: - while s[i] in strutils.digits: addx() + if s[i] in strutils.Digits: + while s[i] in strutils.Digits: addx() else: addx() else: addx() |