Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,21 @@
procedure main()
s := "a!===b=!=c"
# just list the tokens
every writes(multisplit(s,["==", "!=", "="])," ") | write()
# list tokens and indices
every ((p := "") ||:= t := multisplit(s,sep := ["==", "!=", "="])) | break write() do
if t == !sep then writes(t," (",*p+1-*t,") ") else writes(t," ")
end
procedure multisplit(s,L)
s ? while not pos(0) do {
t := =!L | 1( arb(), match(!L)|pos(0) )
suspend t
}
end
procedure arb()
suspend .&subject[.&pos:&pos <- &pos to *&subject + 1]
end