src/Pure/General/symbol_pos.ML
changeset 32784 1a5dde5079ac
parent 30586 9674f64a0702
child 36957 cdb9e83abfbe
equal deleted inserted replaced
32783:e43d761a742d 32784:1a5dde5079ac
   159 
   159 
   160 type text = string;
   160 type text = string;
   161 
   161 
   162 fun pad [] = []
   162 fun pad [] = []
   163   | pad [(s, _)] = [s]
   163   | pad [(s, _)] = [s]
   164   | pad ((s1, pos1) :: (rest as (s2, pos2) :: _)) =
   164   | pad ((s1, pos1) :: (rest as (_, pos2) :: _)) =
   165       let
   165       let
   166         val end_pos1 = Position.advance s1 pos1;
   166         val end_pos1 = Position.advance s1 pos1;
   167         val d = Int.max (0, Position.distance_of end_pos1 pos2);
   167         val d = Int.max (0, Position.distance_of end_pos1 pos2);
   168       in s1 :: replicate d Symbol.DEL @ pad rest end;
   168       in s1 :: replicate d Symbol.DEL @ pad rest end;
   169 
   169