Commits

Paweł Wieczorek committed 3d4f94b

minor

Comments (0)

Files changed (2)

src/Prioritized.ml

 
 let psp_empty = psp_group []
 
+let psp_id psp = psp
+
+let psp_nothing _ = psp_empty
+
 let psp_reprioritize n (_, sp) = (n, sp)
 
 let is_multiline    = unhask_sp0 Basic.is_multiline
  * 
  *)
 
-let psp_indent_when_multiline prio psp =
+let psp_indent_group_with_priority_when_multiline prio psp =
     if any_multiline psp
     then psp_indent_group_with_priority prio psp
     else psp_group_with_priority prio psp
 
+let psp_indent_group_when_multiline = psp_indent_group_with_priority psp_min_priority
+
+let psp_indent_with_priority_when_multiline prio psp =
+    if is_multiline psp
+    then psp_indent_with_priority prio psp
+    else psp
+
+let psp_indent_when_multiline = psp_indent_with_priority_when_multiline psp_min_priority
+
 (*--------------------------------------------------------------------------------------------------------------------
  * correct_priority
  *)

src/Prioritized.mli

 (** priority *)
 type priority = int
 
-
-(** associtivity *)
-type associativity
-    = LeftAssociative
-    | RightAssociative
-    | NoAssociative
-
 (**
     The [ with_priority prio sp ] embeds a basic string pinter [ sp ] with priority [ prio ]
     as prioritrized painter.
 (** Breaks not empty line. *)
 val psp_break : painter
 
+(** Identity on painter. *)
+val psp_id : painter -> painter
+
+(** Returns empty painter for each argument. *)
+val psp_nothing : 'a -> painter
+
 (** Breaks line. *)
 val psp_newline : painter
 
+(** Paints nothing. *)
+val psp_empty : painter
+
 (** Paints a word. *)
 val psp_word : string -> painter
 
 (** Paints an boolean value.  *)
 val psp_value_bool : bool -> painter
 
+val psp_indent_with_priority_when_multiline : priority -> painter -> painter
+
+val psp_indent_when_multiline : painter -> painter
+
+val psp_indent_group_when_multiline : painter list -> painter
+
+val psp_indent_group_with_priority_when_multiline : priority -> painter list -> painter
+
 (**
    The [ psp_bracket opening closing prio elem ] parenthesis [ elem ] with given brackets.
  *)
 
 val psp_decide_std_bracket : bool -> painter -> painter
 
+
+(** associtivity *)
+type associativity
+    = LeftAssociative
+    | RightAssociative
+    | NoAssociative
+
 (**
    The [ psp_infix assoc prio oper left right ] paints an infix operators with auto-parenthesis. 
  *)