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/pegs.nim | |
parent | 3d696c3da53e5c41d839d8265fbc94f1c64980bb (diff) | |
download | Nim-46c41e43690cba9bc1caff6a994bb6915df8a1b7.tar.gz |
p[] instead of p^
Diffstat (limited to 'lib/pure/pegs.nim')
-rwxr-xr-x | lib/pure/pegs.nim | 14 |
1 files changed, 7 insertions, 7 deletions
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: |