markup: emit as control information -- no indent text;
authorwenzelm
Sat, 07 Jul 2007 12:16:16 +0200
changeset 23628 41cdbfb9f77b
parent 23627 f543538866a2
child 23629 8a0cbe8f0566
markup: emit as control information -- no indent text;
src/Pure/General/pretty.ML
--- a/src/Pure/General/pretty.ML	Sat Jul 07 12:16:15 2007 +0200
+++ b/src/Pure/General/pretty.ML	Sat Jul 07 12:16:16 2007 +0200
@@ -130,6 +130,12 @@
   pos = 0,
   nl = nl + 1};
 
+fun control s {tx, ind, pos: int, nl} : text =
+ {tx = Buffer.add s tx,
+  ind = ind,
+  pos = pos,
+  nl = nl};
+
 fun string (s, len) {tx, ind, pos: int, nl} : text =
  {tx = Buffer.add s tx,
   ind = Buffer.add s ind,
@@ -192,9 +198,9 @@
               else (set_indent pos'', pos'');
             val (bg, en) = if markup = Markup.none then ("", "") else mode_markup markup;
             val btext: text = text
-              |> string (bg, 0)
+              |> control bg
               |> format (bes, block', breakdist (es, after))
-              |> string (en, 0);
+              |> control en;
             (*if this block was broken then force the next break*)
             val es' = if nl < #nl btext then forcenext es else es;
           in format (es', block, after) btext end