hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 625fd7e22a5381b8a694651a78d46f86d1a6c33e
parent c6660bc935920408d79ec593b6731ad98c77d6ee
Author: Autumn! <autumnull@posteo.net>
Date:   Thu, 11 May 2023 14:08:17 +0000

strings: fix docstring format for multireplace

Signed-off-by: Autumn! <autumnull@posteo.net>

Diffstat:
Mstrings/replace.ha | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/strings/replace.ha b/strings/replace.ha @@ -14,8 +14,10 @@ export fn replace(s: str, needle: str, target: str) str = { // occurs in a single pass of 's', and works like in [[replace]], except that // replacement pairs found earlier in 'repls' will take precedence over later // ones. For example: +// // assert(multireplace("hello there", ("e", "a"), ("a", "x"), ("ell", "eww")) == "hallo thara"); // assert(multireplace("hello there", ("ell", "eww"), ("e", "a")) == "hewwo thara"); +// // The caller must free the return value. export fn multireplace(s: str, repls: (str, str)...) str = { let replb: []([]u8, []u8) = alloc([], len(repls));