Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,16 @@
procedure main()
every (unstripped := "") ||:= !&input || "\n" # Load file as one string
write(stripBlockComment(unstripped,"/*","*/"))
end
procedure stripBlockComment(s1,s2,s3) #: strip comments between s2-s3 from s1
result := ""
s1 ? {
while result ||:= tab(find(s2)) do {
move(*s2)
tab(find(s3)|0) # or end of string
move(*s3)
}
return result || tab(0)
}
end

View file

@ -0,0 +1,14 @@
procedure main()
every writes(stripBlockComment(!&input,"/*","*/"))
end
procedure stripBlockComment(s,s2,s3)
static inC # non-null when inside comment
(s||"\n") ? while not pos(0) do {
if /inC then
if inC := 1(tab(find(s2))\1, move(*s2)) then suspend inC
else return tab(0)
else if (tab(find(s3))\1,move(*s3)) then inC := &null
else fail
}
end