From: "akr (Akira Tanaka)" Date: 2022-05-07T01:38:15+00:00 Subject: [ruby-core:108476] [Ruby master Feature#18654] Enhancements to prettyprint Issue #18654 has been updated by akr (Akira Tanaka). kddeisz (Kevin Newton) wrote in #note-4: > The algorithm difference of printing after the whole doc tree is built versus printing while it's being built is an implementation detail I designed PrettyPrint that can handle infinite input. So it is degradation and I don't want to accept it. In general, I couldn't understand why new nodes are required. I think that it is possible to implement a method to break all outer groups. So I can't understand why BreakParent node is required. I feel IfBreak is too complex: it contains two sets of nodes. It seems that trailing comma and {}/do-end require only two texts (not sets of nodes). So, it would be enough to extend text method to have two texts for the surrounding group is broken and not. I couldn't understand why Indent node is required. There is PrettyPrint.nest method. I couldn't understand Trim node. I couldn't understand Align node well but I guess it is much different from current algorithm. I think LineSuffix node to support here-document in PrettyPrint makes the algorithm too complex. How about post-processing to support here-document? Since PrettyPrint can pass any object to output, we can pass an object to represent heredoc marker and heredoc content, such as [:heredoc, "<