summaryrefslogtreecommitdiff
path: root/src/pretty.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-08-13 16:39:52 +0200
committerLaurenz <laurmaedje@gmail.com>2021-08-13 16:55:45 +0200
commit6a3385e4e77ce7672bcc80941bf02c8218f344a2 (patch)
tree7ae5d668cf7d734f81f1e9d604bbe46fa0775ed8 /src/pretty.rs
parent144f20882136ef81b79d77bd8a68f42b76c66676 (diff)
Argument collection and spreading
Diffstat (limited to 'src/pretty.rs')
-rw-r--r--src/pretty.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/pretty.rs b/src/pretty.rs
index 52300546..179e5d2d 100644
--- a/src/pretty.rs
+++ b/src/pretty.rs
@@ -357,6 +357,10 @@ impl Pretty for CallArg {
match self {
Self::Pos(expr) => expr.pretty(p),
Self::Named(named) => named.pretty(p),
+ Self::Spread(expr) => {
+ p.push_str("..");
+ expr.pretty(p);
+ }
}
}
}
@@ -375,6 +379,10 @@ impl Pretty for ClosureParam {
match self {
Self::Pos(ident) => ident.pretty(p),
Self::Named(named) => named.pretty(p),
+ Self::Sink(ident) => {
+ p.push_str("..");
+ ident.pretty(p);
+ }
}
}
}
@@ -496,6 +504,7 @@ impl Pretty for Value {
Self::Dict(v) => v.pretty(p),
Self::Template(v) => v.pretty(p),
Self::Func(v) => v.pretty(p),
+ Self::Args(v) => v.pretty(p),
Self::Dyn(v) => v.pretty(p),
}
}