diff options
author | Andreas Rumpf <andreas@andreas-desktop> | 2010-02-27 00:53:31 +0100 |
---|---|---|
committer | Andreas Rumpf <andreas@andreas-desktop> | 2010-02-27 00:53:31 +0100 |
commit | 230567588b22674e6132411803a518a9a901ff50 (patch) | |
tree | d05b9558a4b4c1a1b4cfc0e69ae88282be1ffbfc /lib/pure/pegs.nim | |
parent | 40ea1d0330150a6c771baf25eeaadc1d957fa345 (diff) | |
download | Nim-230567588b22674e6132411803a518a9a901ff50.tar.gz |
further cleanup for new GTK wrapper
Diffstat (limited to 'lib/pure/pegs.nim')
-rwxr-xr-x | lib/pure/pegs.nim | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/pure/pegs.nim b/lib/pure/pegs.nim index 4f55a1883..2cfae3201 100755 --- a/lib/pure/pegs.nim +++ b/lib/pure/pegs.nim @@ -588,18 +588,13 @@ proc m(s: string, p: TPeg, start: int, c: var TMatchClosure): int = #else: silently ignore the capture else: c.ml = idx - of pkBackRef: - if p.index >= c.ml: return -1 - var (a, b) = c.matches[p.index] - result = m(s, term(s.copy(a, b)), start, c) - of pkBackRefIgnoreCase: - if p.index >= c.ml: return -1 - var (a, b) = c.matches[p.index] - result = m(s, termIgnoreCase(s.copy(a, b)), start, c) - of pkBackRefIgnoreStyle: + of pkBackRef..pkBackRefIgnoreStyle: if p.index >= c.ml: return -1 var (a, b) = c.matches[p.index] - result = m(s, termIgnoreStyle(s.copy(a, b)), start, c) + var n: TPeg + n.kind = succ(pkTerminal, ord(p.kind)-ord(pkBackRef)) + n.term = s.copy(a, b) + result = m(s, n, start, c) of pkRule, pkList: assert false proc match*(s: string, pattern: TPeg, matches: var openarray[string], |