14 lines
378 B
Plaintext
14 lines
378 B
Plaintext
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;
|