Closed shawnhyam closed 1 week ago
I did this as a learning exercise, to separate out the state that was part of the algorithm vs. the state that was part of the output stream. To me it makes things a bit easier to grok, interested in your thoughts on it.
This change breaks up the PrettyPrint class into one piece that is responsible for tracking the state of the pretty printing algorithm - processing the tokens, tracking the break stack, comma delimited region stack, etc.; and another piece that is responsible for assembling the output and tracking the state of the output - current line, column position, and indentation.