Add "pretty" subcommand

This commit is contained in:
Joscha 2022-11-20 18:27:25 +01:00
parent 43d5b6d5ae
commit 407786b98c
4 changed files with 74 additions and 1 deletions

9
src/pretty.rs Normal file
View file

@ -0,0 +1,9 @@
use pretty::{DocAllocator, DocBuilder, Pretty};
use crate::ast::Program;
impl<'a, A: DocAllocator<'a>> Pretty<'a, A> for Program {
fn pretty(self, allocator: &'a A) -> DocBuilder<'a, A, ()> {
allocator.text("Hello world")
}
}