Commits

Paweł Wieczorek committed 0296e1c

removed old psp_indent/nested

  • Participants
  • Parent commits 930dd34

Comments (0)

Files changed (3)

 author          = "Pawel Wieczorek"
 name            = "stringpainter"
-version         = "0.2"
+version         = "0.3"
 description     = "Pretty printing combinators, designed for printing ASTs."
 
 archive(native) = "StringPainter.cmxa"

File src/Prioritized.ml

 
 let get_painter  p = snd p
 
-let psp_nested prio (xs : painter list) : painter = (prio, Basic.sp_nested (List.map get_painter xs))
-
 let psp_group_with_priority prio (xs : painter list) : painter = (prio, Basic.sp_nested (List.map get_painter xs))
 
 let psp_group = psp_group_with_priority psp_min_priority
 
 let psp_indent_group = psp_indent_group_with_priority psp_min_priority
 
-let psp_indent prio xs = (prio, Basic.sp_indent (List.map get_painter xs))
+let psp_indent_with_priority prio x = psp_indent_group_with_priority prio [x]
 
-let psp_indent_with_priority' prio x = psp_indent_group_with_priority prio [x]
-
-let psp_indent' = psp_indent_with_priority' psp_min_priority
+let psp_indent = psp_indent_with_priority psp_min_priority
 
 let psp_empty = psp_group []
 
  * 
  *)
 
-let psp_bracket psp_opening psp_closing n psp_elem = psp_nested n
+let psp_bracket psp_opening psp_closing n psp_elem = psp_group_with_priority n
     [ psp_opening
     ; psp_elem
     ; psp_closing
 
 let psp_indent_when_multiline prio psp =
     if any_multiline psp
-    then psp_indent prio psp
-    else psp_nested prio psp
+    then psp_indent_group_with_priority prio psp
+    else psp_group_with_priority prio psp
 
 (*--------------------------------------------------------------------------------------------------------------------
  * correct_priority
 let psp_associative_infix f_left f_right prio oper left right =
     let prio_left  = get_priority left in
     let prio_right = get_priority right in 
-    psp_nested prio
+    psp_group_with_priority prio
         [ psp_decide_std_bracket (f_left prio_left prio) left
         ; oper
         ; psp_decide_std_bracket (f_right prio prio_right) right
 let print_painter psp      = Basic.print_painter (get_painter psp)
 let render_painter psp     = Basic.render_painter (get_painter psp)
 
-let print_painters_nl psps = print_painter_nl (psp_nested 0 psps)
-let print_painters psps    = print_painter (psp_nested 0 psps)
-let render_painters psps   = render_painter (psp_nested 0 psps)
+let print_painters_nl psps = print_painter_nl (psp_group psps)
+let print_painters psps    = print_painter (psp_group psps)
+let render_painters psps   = render_painter (psp_group psps)
 

File src/Prioritized.mli

 (** Returns basic painter from prioritized one. *)
 val get_painter :  painter -> Basic.painter
 
-(** Group list of painters as one painter with given priority. (deprecated) *)
-val psp_nested : priority -> painter list -> painter
-
 (** Group list of painters as one painter with given priority. *)
 val psp_group_with_priority : priority -> painter list -> painter
 
 (** Group list of painters as one painter with the [psp_min_priority] priority. *)
 val psp_group: painter list -> painter
 
-(** deprecated *)
-val psp_indent : priority->  painter list -> painter
+val psp_indent_with_priority : priority->  painter -> painter
 
-val psp_indent_with_priority' : priority->  painter -> painter
-
-val psp_indent' : painter -> painter
+val psp_indent : painter -> painter
 
 (** Group and indent list of painters as one painter with given priority. *)
 val psp_indent_group_with_priority : priority->  painter list -> painter