summaryrefslogtreecommitdiff
path: root/src/pretty.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-06-26 18:07:05 +0200
committerLaurenz <laurmaedje@gmail.com>2021-06-26 18:07:05 +0200
commit422b8e640f00977177a5a7250a3c56009eed10c4 (patch)
treeb1a21718e9511d776a6de47b713e3308bb1baaad /src/pretty.rs
parentd53c933e4d56e6c0484d81814779ddb1597ee032 (diff)
With expressions
Diffstat (limited to 'src/pretty.rs')
-rw-r--r--src/pretty.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/pretty.rs b/src/pretty.rs
index e2942f6f..216a6370 100644
--- a/src/pretty.rs
+++ b/src/pretty.rs
@@ -217,6 +217,7 @@ impl Pretty for Expr {
Self::Binary(v) => v.pretty(p),
Self::Call(v) => v.pretty(p),
Self::Closure(v) => v.pretty(p),
+ Self::With(v) => v.pretty(p),
Self::Let(v) => v.pretty(p),
Self::If(v) => v.pretty(p),
Self::While(v) => v.pretty(p),
@@ -370,6 +371,15 @@ impl Pretty for ClosureExpr {
}
}
+impl Pretty for WithExpr {
+ fn pretty(&self, p: &mut Printer) {
+ self.callee.pretty(p);
+ p.push_str(" with (");
+ self.args.pretty(p);
+ p.push(')');
+ }
+}
+
impl Pretty for LetExpr {
fn pretty(&self, p: &mut Printer) {
p.push_str("let ");
@@ -539,7 +549,7 @@ impl Pretty for FuncArgs {
impl Pretty for FuncArg {
fn pretty(&self, p: &mut Printer) {
if let Some(name) = &self.name {
- p.push_str(&name.v);
+ p.push_str(&name);
p.push_str(": ");
}
self.value.v.pretty(p);