raz / test / err / CommentEnded.raz

22 lines · 456 B · raw · history · last change 27a380c2

1module CommentEnded;
2import Out;
3(* a comment that quotes the two characters that end one ends there *)
4
5(* Whether s matches the pattern.
6 Matches (?>x*) as one atom, which never gives back what it took,
7 so that a pattern stays linear. *)
8proc matches(s: []U8): BOOL;
9var i: INT;
10begin
11 i := 0;
12 while i < LEN(s) do
13 INC(i);
14 end;
15 return i > 0;
16end;
17
18proc main*;
19begin
20 if matches("a") then Out.ln; end;
21end;
22end CommentEnded.