Skip to content

Pretty-printing library#256

Open
wojpok wants to merge 22 commits intofram-lang:masterfrom
wojpok:pp
Open

Pretty-printing library#256
wojpok wants to merge 22 commits intofram-lang:masterfrom
wojpok:pp

Conversation

@wojpok
Copy link
Collaborator

@wojpok wojpok commented Aug 17, 2025

A Pretty-printing library with shift/reset aligment operators and true horizontal catenation.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@wojpok wojpok marked this pull request as draft December 11, 2025 09:12
@wojpok
Copy link
Collaborator Author

wojpok commented Dec 11, 2025

I moved this PR as draft. I will update it once testing framework is ready

@wojpok wojpok marked this pull request as ready for review January 21, 2026 19:27
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@wojpok wojpok requested a review from ppolesiuk February 28, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants