Data update
This commit is contained in:
parent
72eb4943cb
commit
4d5544505c
2347 changed files with 62432 additions and 16731 deletions
|
|
@ -0,0 +1 @@
|
|||
strip ← {(~⌽∧\⌽' '=z)/z←(∧\~⍵∊⍺)/⍵}
|
||||
|
|
@ -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 " "[#;].+"))
|
||||
|
|
@ -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;
|
||||
};
|
||||
|
|
@ -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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue