Pretty print programs partially

This commit is contained in:
Joscha 2022-11-20 20:32:14 +01:00
parent 1b364061e4
commit 200b653e61
3 changed files with 28 additions and 17 deletions

23
src/pretty/program.rs Normal file
View file

@ -0,0 +1,23 @@
use pretty::RcDoc;
use crate::ast::Program;
impl Program {
pub fn to_doc(&self) -> RcDoc {
match self {
Program::Expr {
s0,
expr,
s1,
span: _,
} => RcDoc::nil(),
Program::Module {
s0,
s1,
elems,
s2,
span: _,
} => RcDoc::text("module"),
}
}
}