Skip to content

Commit 0333e12

Browse files
planetis-mnitelyringabout
authored
Fix for latest's Nim stricter effect tracking (#110)
* Fix for latest's Nim stricter effect tracking * Fix mistake * omg * Update src/regex.nim Co-authored-by: flywind <xzsflywind@gmail.com> Co-authored-by: Esteban C Borsani <ecastroborsani@gmail.com> Co-authored-by: flywind <xzsflywind@gmail.com>
1 parent eeefb4f commit 0333e12

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/regex.nim

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,12 +828,15 @@ func replace*(
828828
if limit > 0 and j == limit: break
829829
result.addsubstr(s, i)
830830

831+
when not defined(nimHasEffectsOf):
832+
{.pragma: effectsOf.}
833+
831834
func replace*(
832835
s: string,
833836
pattern: Regex,
834837
by: proc (m: RegexMatch, s: string): string,
835838
limit = 0
836-
): string {.inline, raises: [].} =
839+
): string {.inline, raises: [], effectsOf: by.} =
837840
## Replace matched substrings.
838841
##
839842
## If ``limit`` is given, at most ``limit``

0 commit comments

Comments
 (0)