Move test scripts into test-scripts

This commit is contained in:
2025-01-08 13:29:40 +01:00
parent 3a857e8980
commit 45b5ba897b
11 changed files with 0 additions and 0 deletions

97
test-scripts/find-replace Executable file
View File

@ -0,0 +1,97 @@
#!/usr/bin/env curly
>main
gto
:find
=i
=term
=text
$i
:loop
=_
$text
$i
dup
$term
len
add
slc
=part
$i
dup
inc
=i
$i
$text
len
$term
len
sub
>not-found
ggt
$part
$term
>loop
gne
ret
:not-found
neg
ret
:replace-all
=replacement
=quest
=target
\
=result
0
=from
:replace-loop
$target
$quest
$from
>find
fun
=pos
$pos
0
>replace-done
glt
$result
$target
$from
$pos
slc
$replacement
cat
cat
=result
$pos
$quest
len
add
=from
>replace-loop
gto
:replace-done
$result
$target
$from
$target
len
slc
cat
ret
:main
\Bananen hangen in warme landen aan de bananenboom.
\an
\@|\|
>replace-all
fun
out
=_
$target
\en
\un
>replace-all
fun
out
end