Skip to content

Commit 94111c7

Browse files
committed
move method to avoid forward declares
fix koch docs generation
1 parent c26614b commit 94111c7

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

lib/pure/strutils.nim

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,21 +1781,6 @@ func initSkipTable*(a: var SkipTable, sub: string) {.rtl,
17811781
## Deprecated: Does nothing. Exists solely for backwards compatibility.
17821782
discard
17831783

1784-
# Forward declare
1785-
func find*(s, sub: string, start: Natural = 0, last = 0): int {.rtl,
1786-
extern: "nsuFindStr", deprecated: "use strbasics.indexOf", raises: [].}
1787-
1788-
func find*(a: SkipTable, s, sub: string, start: Natural = 0, last = 0): int {.
1789-
rtl, extern: "nsuFindStrA", deprecated: "use strbasics.indexOf".} =
1790-
## Deprecated: use `strbasics.indexOf func<strbasics.html#indexOf,openArray[char],openArray[char]>`_.
1791-
##
1792-
## Shorthand for `find(s, sub, start, last)`. Makes no use of the `SkipTable`.
1793-
##
1794-
## See also:
1795-
## * `find func<#find,string,string,Natural,int>`_
1796-
## * `strbasics.indexOf func<strbasics.html#indexOf,openArray[char],openArray[char]>`_
1797-
return strutils.find(s, sub, start=start, last=last)
1798-
17991784
func find*(s: string, sub: char, start: Natural = 0, last = 0): int {.rtl,
18001785
extern: "nsuFindChar", deprecated: "use strbasics.indexOf", raises: [].} =
18011786
## Deprecated: use `strbasics.indexOf func<strbasics.html#indexOf,openArray[char],char>`_.
@@ -1886,6 +1871,17 @@ func find*(s, sub: string, start: Natural = 0, last = 0): int {.rtl,
18861871
else:
18871872
return start + index
18881873

1874+
func find*(a: SkipTable, s, sub: string, start: Natural = 0, last = 0): int {.
1875+
rtl, extern: "nsuFindStrA", deprecated: "use strbasics.indexOf".} =
1876+
## Deprecated: use `strbasics.indexOf func<strbasics.html#indexOf,openArray[char],openArray[char]>`_.
1877+
##
1878+
## Shorthand for `find(s, sub, start, last)`. Makes no use of the `SkipTable`.
1879+
##
1880+
## See also:
1881+
## * `find func<#find,string,string,Natural,int>`_
1882+
## * `strbasics.indexOf func<strbasics.html#indexOf,openArray[char],openArray[char]>`_
1883+
return strutils.find(s, sub, start=start, last=last)
1884+
18891885
func rfind*(s: string, sub: char, start: Natural = 0, last = -1): int {.rtl,
18901886
extern: "nsuRFindChar".} =
18911887
## Searches for `sub` in `s` inside range `start..last` (both ends included)

0 commit comments

Comments
 (0)