diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2018-05-26 19:09:02 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-05-26 19:09:02 +0200 |
commit | 12bd1c494cdbb9d3e87d9479098d0892c2e7a453 (patch) | |
tree | d94c2dd882278c60df7f428e7dcb1fe6cdbf0894 /compiler | |
parent | b885fc906f5df52d73cfcc0e41846d9d20504192 (diff) | |
parent | 65365354706f6a54a7d68b90ea07ee7c709e36ef (diff) | |
download | Nim-12bd1c494cdbb9d3e87d9479098d0892c2e7a453.tar.gz |
fixes merge conflict
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/filter_tmpl.nim | 24 | ||||
-rw-r--r-- | compiler/options.nim | 17 |
2 files changed, 12 insertions, 29 deletions
diff --git a/compiler/filter_tmpl.nim b/compiler/filter_tmpl.nim index f93355e6b..6c16a0b4e 100644 --- a/compiler/filter_tmpl.nim +++ b/compiler/filter_tmpl.nim @@ -42,8 +42,7 @@ proc newLine(p: var TTmplParser) = proc scanPar(p: var TTmplParser, d: int) = var i = d - let hi = p.x.len - 1 - while i <= hi: + while i < p.x.len: case p.x[i] of '(': inc(p.par) of ')': dec(p.par) @@ -63,22 +62,19 @@ const proc parseLine(p: var TTmplParser) = var j = 0 - let hi = p.x.len - 1 + let len = p.x.len - if hi == 0: - return + while j < len and p.x[j] == ' ': inc(j) - while j <= hi and p.x[j] == ' ': inc(j) - - if p.x.len >= 2 and p.x[0] == p.nimDirective and p.x[1] == '?': + if len >= 2 and p.x[0] == p.nimDirective and p.x[1] == '?': newLine(p) - elif j < p.x.len and p.x[j] == p.nimDirective: + elif j < len and p.x[j] == p.nimDirective: newLine(p) inc(j) - while j <= hi and p.x[j] == ' ': inc(j) + while j < len and p.x[j] == ' ': inc(j) let d = j var keyw = "" - while j <= hi and p.x[j] in PatternChars: + while j < len and p.x[j] in PatternChars: add(keyw, p.x[j]) inc(j) @@ -132,7 +128,7 @@ proc parseLine(p: var TTmplParser) = llStreamWrite(p.outp, "(\"") inc(p.emitPar) p.state = psTempl - while j <= hi: + while j < len: case p.x[j] of '\x01'..'\x1F', '\x80'..'\xFF': llStreamWrite(p.outp, "\\x") @@ -160,7 +156,7 @@ proc parseLine(p: var TTmplParser) = llStreamWrite(p.outp, '(') inc(j) var curly = 0 - while j <= hi: + while j < len: case p.x[j] of '{': inc(j) @@ -185,7 +181,7 @@ proc parseLine(p: var TTmplParser) = llStreamWrite(p.outp, p.conc) llStreamWrite(p.outp, p.toStr) llStreamWrite(p.outp, '(') - while j <= hi and p.x[j] in PatternChars: + while j < len and p.x[j] in PatternChars: llStreamWrite(p.outp, p.x[j]) inc(j) llStreamWrite(p.outp, ')') diff --git a/compiler/options.nim b/compiler/options.nim index d1907b1a5..6acf78909 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -263,7 +263,8 @@ proc newConfigRef*(): ConfigRef = linkOptions: "", compileOptions: "", ccompilerpath: "", - toCompile: @[] + toCompile: @[], + arguments: "" ) setTargetFromSystem(result.target) # enable colors by default on terminals @@ -562,20 +563,6 @@ proc isDynlibOverride*(conf: ConfigRef; lib: string): bool = result = optDynlibOverrideAll in conf.globalOptions or conf.dllOverrides.hasKey(lib.canonDynlibName) -proc binaryStrSearch*(x: openArray[string], y: string): int = - var a = 0 - var b = len(x) - 1 - while a <= b: - var mid = (a + b) div 2 - var c = cmpIgnoreCase(x[mid], y) - if c < 0: - a = mid + 1 - elif c > 0: - b = mid - 1 - else: - return mid - result = - 1 - proc parseIdeCmd*(s: string): IdeCmd = case s: of "sug": ideSug |