equal
deleted
inserted
replaced
13 val stringN_of_int : int -> int -> string |
13 val stringN_of_int : int -> int -> string |
14 val strip_spaces : bool -> (char -> bool) -> string -> string |
14 val strip_spaces : bool -> (char -> bool) -> string -> string |
15 val strip_spaces_except_between_idents : string -> string |
15 val strip_spaces_except_between_idents : string -> string |
16 val elide_string : int -> string -> string |
16 val elide_string : int -> string -> string |
17 val nat_subscript : int -> string |
17 val nat_subscript : int -> string |
|
18 val unquote_tvar : string -> string |
18 val unyxml : string -> string |
19 val unyxml : string -> string |
19 val maybe_quote : string -> string |
20 val maybe_quote : string -> string |
20 val string_of_ext_time : bool * Time.time -> string |
21 val string_of_ext_time : bool * Time.time -> string |
21 val string_of_time : Time.time -> string |
22 val string_of_time : Time.time -> string |
22 val type_instance : theory -> typ -> typ -> bool |
23 val type_instance : theory -> typ -> typ -> bool |
122 |
123 |
123 val subscript = implode o map (prefix "\<^isub>") o raw_explode (* FIXME Symbol.explode (?) *) |
124 val subscript = implode o map (prefix "\<^isub>") o raw_explode (* FIXME Symbol.explode (?) *) |
124 fun nat_subscript n = |
125 fun nat_subscript n = |
125 n |> string_of_int |> print_mode_active Symbol.xsymbolsN ? subscript |
126 n |> string_of_int |> print_mode_active Symbol.xsymbolsN ? subscript |
126 |
127 |
|
128 val unquote_tvar = perhaps (try (unprefix "'")) |
|
129 val unquery_var = perhaps (try (unprefix "?")) |
|
130 |
127 val unyxml = XML.content_of o YXML.parse_body |
131 val unyxml = XML.content_of o YXML.parse_body |
128 |
132 |
129 val is_long_identifier = forall Symbol_Pos.is_identifier o Long_Name.explode |
133 val is_long_identifier = forall Symbol_Pos.is_identifier o Long_Name.explode |
130 fun maybe_quote y = |
134 fun maybe_quote y = |
131 let val s = unyxml y in |
135 let val s = unyxml y in |
132 y |> ((not (is_long_identifier (perhaps (try (unprefix "'")) s)) andalso |
136 y |> ((not (is_long_identifier (unquote_tvar s)) andalso |
133 not (is_long_identifier (perhaps (try (unprefix "?")) s))) orelse |
137 not (is_long_identifier (unquery_var s))) orelse |
134 Keyword.is_keyword s) ? quote |
138 Keyword.is_keyword s) ? quote |
135 end |
139 end |
136 |
140 |
137 fun string_of_ext_time (plus, time) = |
141 fun string_of_ext_time (plus, time) = |
138 let val ms = Time.toMilliseconds time in |
142 let val ms = Time.toMilliseconds time in |