6549
|
1 |
(* Title: Pure/Isar/comment.ML
|
|
2 |
ID: $Id$
|
|
3 |
Author: Markus Wenzel, TU Muenchen
|
|
4 |
|
|
5 |
Formal comments.
|
|
6 |
*)
|
|
7 |
|
|
8 |
signature COMMENT =
|
|
9 |
sig
|
|
10 |
type text
|
7631
|
11 |
val string_of: text -> string
|
8076
|
12 |
val plain: string list -> text
|
6725
|
13 |
val none: text
|
|
14 |
val ignore: 'a * text -> 'a
|
6549
|
15 |
type interest
|
7171
|
16 |
val interest: int -> interest
|
6549
|
17 |
val no_interest: interest
|
|
18 |
val default_interest: interest
|
6725
|
19 |
val ignore_interest: 'a * interest -> 'a
|
|
20 |
val ignore_interest': interest * 'a -> 'a
|
6549
|
21 |
end;
|
|
22 |
|
|
23 |
structure Comment: COMMENT =
|
|
24 |
struct
|
|
25 |
|
|
26 |
(** text **)
|
|
27 |
|
8076
|
28 |
datatype text = Text of string list;
|
7631
|
29 |
|
8076
|
30 |
fun string_of (Text ss) = cat_lines ss;
|
6549
|
31 |
val plain = Text;
|
8076
|
32 |
val none = plain [];
|
6725
|
33 |
|
|
34 |
fun ignore (x, _) = x;
|
|
35 |
|
6549
|
36 |
|
|
37 |
|
|
38 |
(** interest **)
|
|
39 |
|
7171
|
40 |
datatype interest = Interest of int;
|
|
41 |
val interest = Interest;
|
|
42 |
val no_interest = interest ~1;
|
|
43 |
val default_interest = interest 0;
|
6549
|
44 |
|
6725
|
45 |
fun ignore_interest (x, _) = x;
|
|
46 |
fun ignore_interest' (_, x) = x;
|
|
47 |
|
|
48 |
|
6549
|
49 |
end;
|