Data update

This commit is contained in:
Ingy döt Net 2025-06-11 20:16:52 -04:00
parent 72eb4943cb
commit 4d5544505c
2347 changed files with 62432 additions and 16731 deletions

View file

@ -0,0 +1 @@
strip {(~\' '=z)/z(\~)/}

View file

@ -0,0 +1,5 @@
(string-trim (string-trim-right " apples, pears # and bananas" "[#;].+"))
(string-trim (string-trim-right " apples, pears ; and bananas" "[#;].+"))
(string-trim (string-trim-right " apples, pears and bananas " "[#;].+"))

View file

@ -0,0 +1,23 @@
$ENTRY Go {
= <Prout <StripComments 'apples, pears # and bananas'>>
<Prout <StripComments 'apples, pears ; and bananas'>>;
};
StripComments {
e.X = <Trim <StripAll (';#') e.X>>;
};
Trim {
e.X ' ' = <Trim e.X>;
e.X = e.X;
};
StripAll {
() e.X = e.X;
(s.C e.C) e.X = <StripAll (e.C) <Strip s.C e.X>>;
};
Strip {
s.C e.X s.C e.Y = e.X;
s.C e.X = e.X;
};

View file

@ -0,0 +1,13 @@
program strip_comments;
print(strip(";#", "apples, pears # and bananas"));
print(strip(";#", "apples, pears ; and bananas"));
print(strip(";#", "apples, pears"));
proc strip(comment_chars, s);
if exists c = s(i) | c in comment_chars then
s := s(..i-1);
end if;
rspan(s, "\n\t ");
return s;
end proc;
end program;