mirror of
https://github.com/janet-lang/janet
synced 2026-05-08 22:42:15 +00:00
c6b802b082
Add some test cases and asserts for new pretty printing - we were not properly handing the case when print formatter was not at the start of the buffer. A simple fix is to add a lookback_barrier, which is an index into the buffer that backtracking print formatter can't go past. This ensures that, whatever newlines are replace with spaces, we don't mess with any explicit newlines that should be printed. Also some tweaks to logic to try an make invariants more obvious and simplify looping and indexing.