diff options
author | Araq <rumpf_a@web.de> | 2011-04-11 23:28:53 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-04-11 23:28:53 +0200 |
commit | 46c41e43690cba9bc1caff6a994bb6915df8a1b7 (patch) | |
tree | c96be792eceb1d189cdb5bcff6e1a06f9b51e76c /lib/pure | |
parent | 3d696c3da53e5c41d839d8265fbc94f1c64980bb (diff) | |
download | Nim-46c41e43690cba9bc1caff6a994bb6915df8a1b7.tar.gz |
p[] instead of p^
Diffstat (limited to 'lib/pure')
-rwxr-xr-x | lib/pure/os.nim | 2 | ||||
-rwxr-xr-x | lib/pure/pegs.nim | 14 | ||||
-rwxr-xr-x | lib/pure/times.nim | 6 |
3 files changed, 11 insertions, 11 deletions
diff --git a/lib/pure/os.nim b/lib/pure/os.nim index d9b81365f..67435667a 100755 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -720,7 +720,7 @@ else: # retrieves the variables of char** env of C's main proc if not envComputed: when useNSGetEnviron: - var gEnv = NSGetEnviron()^ + var gEnv = NSGetEnviron()[] var i = 0 while True: if gEnv[i] == nil: break diff --git a/lib/pure/pegs.nim b/lib/pure/pegs.nim index 2e1d0f0ad..9b2606b33 100755 --- a/lib/pure/pegs.nim +++ b/lib/pure/pegs.nim @@ -120,7 +120,7 @@ proc charSet*(s: set[char]): TPeg {.nosideEffect, rtl, extern: "npegs$1".} = assert '\0' notin s result.kind = pkCharChoice new(result.charChoice) - result.charChoice^ = s + result.charChoice[] = s proc len(a: TPeg): int {.inline.} = return a.sons.len proc add(d: var TPeg, s: TPeg) {.inline.} = add(d.sons, s) @@ -131,9 +131,9 @@ proc addChoice(dest: var TPeg, elem: TPeg) = # caution! Do not introduce false aliasing here! case elem.kind of pkCharChoice: - dest.sons[L] = charSet(dest.sons[L].charChoice^ + elem.charChoice^) + dest.sons[L] = charSet(dest.sons[L].charChoice[] + elem.charChoice[]) of pkChar: - dest.sons[L] = charSet(dest.sons[L].charChoice^ + {elem.ch}) + dest.sons[L] = charSet(dest.sons[L].charChoice[] + {elem.ch}) else: add(dest, elem) else: add(dest, elem) @@ -435,7 +435,7 @@ proc toStrAux(r: TPeg, res: var string) = add(res, 'y') add(res, singleQuoteEsc(r.term)) of pkChar: add(res, singleQuoteEsc(r.ch)) - of pkCharChoice: add(res, charSetEsc(r.charChoice^)) + of pkCharChoice: add(res, charSetEsc(r.charChoice[])) of pkNonTerminal: add(res, r.nt.name) of pkSequence: add(res, '(') @@ -458,7 +458,7 @@ proc toStrAux(r: TPeg, res: var string) = add(res, singleQuoteEsc(r.ch)) add(res, '*') of pkGreedyRepSet: - add(res, charSetEsc(r.charChoice^)) + add(res, charSetEsc(r.charChoice[])) add(res, '*') of pkGreedyAny: add(res, ".*") @@ -640,7 +640,7 @@ proc rawMatch*(s: string, p: TPeg, start: int, c: var TCaptures): int {. if p.ch == s[start]: result = 1 else: result = -1 of pkCharChoice: - if contains(p.charChoice^, s[start]): result = 1 + if contains(p.charChoice[], s[start]): result = 1 else: result = -1 of pkNonTerminal: var oldMl = c.ml @@ -706,7 +706,7 @@ proc rawMatch*(s: string, p: TPeg, start: int, c: var TCaptures): int {. while ch == s[start+result]: inc(result) of pkGreedyRepSet: result = 0 - while contains(p.charChoice^, s[start+result]): inc(result) + while contains(p.charChoice[], s[start+result]): inc(result) of pkOption: result = max(0, rawMatch(s, p.sons[0], start, c)) of pkAndPredicate: diff --git a/lib/pure/times.nim b/lib/pure/times.nim index f428a33b3..eddaf7e3c 100755 --- a/lib/pure/times.nim +++ b/lib/pure/times.nim @@ -1,7 +1,7 @@ # # # Nimrod's Runtime Library -# (c) Copyright 2010 Andreas Rumpf +# (c) Copyright 2011 Andreas Rumpf # # See the file "copying.txt", included in this # distribution, for details about the copyright. @@ -246,13 +246,13 @@ when not defined(ECMAScript): proc getTime(): TTime = return timec(nil) proc getLocalTime(t: TTime): TTimeInfo = var a = t - result = tmToTimeInfo(localtime(addr(a))^) + result = tmToTimeInfo(localtime(addr(a))[]) # copying is needed anyway to provide reentrancity; thus # the convertion is not expensive proc getGMTime(t: TTime): TTimeInfo = var a = t - result = tmToTimeInfo(gmtime(addr(a))^) + result = tmToTimeInfo(gmtime(addr(a))[]) # copying is needed anyway to provide reentrancity; thus # the convertion is not expensive |