154 fun markup m prts = markup_block m (0, prts); |
154 fun markup m prts = markup_block m (0, prts); |
155 fun mark m prt = if m = Markup.empty then prt else markup m [prt]; |
155 fun mark m prt = if m = Markup.empty then prt else markup m [prt]; |
156 fun mark_str (m, s) = mark m (str s); |
156 fun mark_str (m, s) = mark m (str s); |
157 fun marks_str (ms, s) = fold_rev mark ms (str s); |
157 fun marks_str (ms, s) = fold_rev mark ms (str s); |
158 |
158 |
159 fun command name = mark_str (Isabelle_Markup.keyword1, name); |
159 fun command name = mark_str (Markup.keyword1, name); |
160 fun keyword name = mark_str (Isabelle_Markup.keyword2, name); |
160 fun keyword name = mark_str (Markup.keyword2, name); |
161 |
161 |
162 val text = breaks o map str o Symbol.explode_words; |
162 val text = breaks o map str o Symbol.explode_words; |
163 val paragraph = markup Isabelle_Markup.paragraph; |
163 val paragraph = markup Markup.paragraph; |
164 val para = paragraph o text; |
164 val para = paragraph o text; |
165 |
165 |
166 fun markup_chunks m prts = markup m (fbreaks prts); |
166 fun markup_chunks m prts = markup m (fbreaks prts); |
167 val chunks = markup_chunks Markup.empty; |
167 val chunks = markup_chunks Markup.empty; |
168 fun chunks2 prts = blk (0, flat (Library.separate [fbrk, fbrk] (map single prts))); |
168 fun chunks2 prts = blk (0, flat (Library.separate [fbrk, fbrk] (map single prts))); |
302 fun symbolic prt = |
302 fun symbolic prt = |
303 let |
303 let |
304 fun out (Block ((bg, en), [], _, _)) = Buffer.add bg #> Buffer.add en |
304 fun out (Block ((bg, en), [], _, _)) = Buffer.add bg #> Buffer.add en |
305 | out (Block ((bg, en), prts, indent, _)) = |
305 | out (Block ((bg, en), prts, indent, _)) = |
306 Buffer.add bg #> |
306 Buffer.add bg #> |
307 Buffer.markup (Isabelle_Markup.block indent) (fold out prts) #> |
307 Buffer.markup (Markup.block indent) (fold out prts) #> |
308 Buffer.add en |
308 Buffer.add en |
309 | out (String (s, _)) = Buffer.add s |
309 | out (String (s, _)) = Buffer.add s |
310 | out (Break (false, wd)) = |
310 | out (Break (false, wd)) = |
311 Buffer.markup (Isabelle_Markup.break wd) (Buffer.add (output_spaces wd)) |
311 Buffer.markup (Markup.break wd) (Buffer.add (output_spaces wd)) |
312 | out (Break (true, _)) = Buffer.add (Output.output "\n"); |
312 | out (Break (true, _)) = Buffer.add (Output.output "\n"); |
313 in out prt Buffer.empty end; |
313 in out prt Buffer.empty end; |
314 |
314 |
315 (*unformatted output*) |
315 (*unformatted output*) |
316 fun unformatted prt = |
316 fun unformatted prt = |