pub fn pretty_print(expr: &Expr) -> StringExpand description
Pretty print an expression to a string.
The output uses Haskell-style surface syntax with minimal parentheses.
ยงExamples
use std::sync::Arc;
use panproto_expr::{Expr, Literal, BuiltinOp};
use panproto_expr_parser::pretty_print;
let e = Expr::Builtin(BuiltinOp::Add, vec![
Expr::Var(Arc::from("x")),
Expr::Lit(Literal::Int(1)),
]);
assert_eq!(pretty_print(&e), "x + 1");