Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a comprehensive pretty-printing library for the Fram language, featuring advanced alignment operators using shift/reset mechanisms and true horizontal concatenation. The library enables flexible document layout with automatic width management, non-local alignments for table formatting, and ANSI terminal styling support.
Key Changes:
- Implements a sophisticated pretty-printing algorithm with layout selection based on Pareto optimality
- Adds shift/reset alignment operators for automatic column alignment without pre-calculation
- Provides true vertical concatenation (
>+>) in addition to standard horizontal (<>) and line-break ($$) operators
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 23 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/Pretty.fram | Main public API exposing document types and combinators |
| lib/Pretty/Core.fram | Core layout algorithm with Pareto selection and stream-based layout generation |
| lib/Pretty/Size.fram | Size tracking with shift lists for managing floating alignment points |
| lib/Pretty/Lines.fram | Line representation and rendering with alignment state management |
| lib/Pretty/Style.fram | ANSI terminal styling support with color and text decoration options |
| lib/Stream.fram | Adds lazyStream helper for lazy stream construction |
| pretty/examples/Example1-impPrettyPrinter.fram | IMP language pretty-printer demonstrating library features |
| pretty/examples/Example2-table.fram | Table formatting example using vertical separators |
| pretty/tutorial/Tutorial1-basic.fram | Basic text document tutorial |
| pretty/tutorial/Tutorial2-combine.fram | Horizontal combination operator tutorial |
| pretty/tutorial/Tutorial3-flush.fram | Line break insertion tutorial |
| pretty/tutorial/Tutorial4-vcat.fram | Vertical concatenation tutorial |
| pretty/tutorial/Tutorial5-hang.fram | Hanging indent tutorial |
| pretty/tutorial/Tutorial6-aligns.fram | Shift operator tutorial |
| pretty/tutorial/Tutorial7-alignScopes.fram | Reset operator for alignment scopes tutorial |
| pretty/tutorial/Tutorial8-hcat.fram | True horizontal concatenation tutorial |
| pretty/tutorial/Tutorial9-vsep.fram | Vertical separator usage tutorial |
| pretty/tutorial/Tutorial10-style.fram | ANSI styling tutorial |
| pretty/test/Test1-tablesWithHang.fram | Test for table formatting with hanging indents |
| pretty/test/Test2-alignmentsUnderCat.fram | Test for alignments under concatenation operators |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I moved this PR as draft. I will update it once testing framework is ready |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 24 out of 24 changed files in this pull request and generated 17 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
A Pretty-printing library with shift/reset aligment operators and true horizontal catenation.