diff options
author | Araq <rumpf_a@web.de> | 2012-07-08 21:03:47 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2012-07-08 21:03:47 +0200 |
commit | 4fbba0a65ad310ba9498f1cf9f79eb0826b19f81 (patch) | |
tree | dece3596fbdf153263f5672b4011139f70a4df6a /lib/impure/re.nim | |
parent | 36247e0947699a56d5bc51d48188b6dda1815587 (diff) | |
download | Nim-4fbba0a65ad310ba9498f1cf9f79eb0826b19f81.tar.gz |
changed integer promotion rules; breaks bootstrapping and lots of code
Diffstat (limited to 'lib/impure/re.nim')
-rwxr-xr-x | lib/impure/re.nim | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/impure/re.nim b/lib/impure/re.nim index 1fe1582bd..f3a6e5a44 100755 --- a/lib/impure/re.nim +++ b/lib/impure/re.nim @@ -82,7 +82,7 @@ proc matchOrFind(s: string, pattern: TRegEx, matches: var openarray[string], start, flags: cint): cint = var rawMatches: array[0..maxSubpatterns * 3 - 1, cint] - res = pcre.Exec(pattern.h, pattern.e, s, len(s), start, flags, + res = pcre.Exec(pattern.h, pattern.e, s, len(s).cint, start, flags, cast[ptr cint](addr(rawMatches)), maxSubpatterns * 3) if res < 0'i32: return res for i in 1..int(res)-1: @@ -100,7 +100,7 @@ proc findBounds*(s: string, pattern: TRegEx, matches: var openarray[string], ## is written into `matches` and ``(-1,0)`` is returned. var rawMatches: array[0..maxSubpatterns * 3 - 1, cint] - res = pcre.Exec(pattern.h, pattern.e, s, len(s), start, 0'i32, + res = pcre.Exec(pattern.h, pattern.e, s, len(s).cint, start, 0'i32, cast[ptr cint](addr(rawMatches)), maxSubpatterns * 3) if res < 0'i32: return (-1, 0) for i in 1..int(res)-1: @@ -119,7 +119,7 @@ proc findBounds*(s: string, pattern: TRegEx, ## ``(-1,0)`` is returned. var rawMatches: array[0..maxSubpatterns * 3 - 1, cint] - res = pcre.Exec(pattern.h, pattern.e, s, len(s), start, 0'i32, + res = pcre.Exec(pattern.h, pattern.e, s, len(s).cint, start, 0'i32, cast[ptr cint](addr(rawMatches)), maxSubpatterns * 3) if res < 0'i32: return (-1, 0) for i in 1..int(res)-1: @@ -135,14 +135,14 @@ proc findBounds*(s: string, pattern: TRegEx, ## match, ``(-1,0)`` is returned. var rawMatches: array[0..3 - 1, cint] - res = pcre.Exec(pattern.h, nil, s, len(s), start, 0'i32, + res = pcre.Exec(pattern.h, nil, s, len(s).cint, start, 0'i32, cast[ptr cint](addr(rawMatches)), 3) if res < 0'i32: return (int(res), 0) return (int(rawMatches[0]), int(rawMatches[1]-1)) proc matchOrFind(s: string, pattern: TRegEx, start, flags: cint): cint = var rawMatches: array [0..maxSubpatterns * 3 - 1, cint] - result = pcre.Exec(pattern.h, pattern.e, s, len(s), start, flags, + result = pcre.Exec(pattern.h, pattern.e, s, len(s).cint, start, flags, cast[ptr cint](addr(rawMatches)), maxSubpatterns * 3) if result >= 0'i32: result = rawMatches[1] - rawMatches[0] @@ -180,7 +180,7 @@ proc find*(s: string, pattern: TRegEx, matches: var openarray[string], ## is written into ``matches`` and -1 is returned. var rawMatches: array[0..maxSubpatterns * 3 - 1, cint] - res = pcre.Exec(pattern.h, pattern.e, s, len(s), start, 0'i32, + res = pcre.Exec(pattern.h, pattern.e, s, len(s).cint, start, 0'i32, cast[ptr cint](addr(rawMatches)), maxSubpatterns * 3) if res < 0'i32: return res for i in 1..int(res)-1: @@ -195,7 +195,7 @@ proc find*(s: string, pattern: TRegEx, start = 0): int = ## match, -1 is returned. var rawMatches: array[0..3 - 1, cint] - res = pcre.Exec(pattern.h, nil, s, len(s), start, 0'i32, + res = pcre.Exec(pattern.h, nil, s, len(s).cint, start, 0'i32, cast[ptr cint](addr(rawMatches)), 3) if res < 0'i32: return res return rawMatches[0] @@ -205,7 +205,7 @@ iterator findAll*(s: string, pattern: TRegEx, start = 0): string = var i = int32(start) var rawMatches: array[0..maxSubpatterns * 3 - 1, cint] while true: - let res = pcre.Exec(pattern.h, pattern.e, s, len(s), i, 0'i32, + let res = pcre.Exec(pattern.h, pattern.e, s, len(s).cint, i, 0'i32, cast[ptr cint](addr(rawMatches)), maxSubpatterns * 3) if res < 0'i32: break let a = rawMatches[0] |