diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-02-12 23:14:29 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-02-12 23:14:29 +0100 |
| commit | db1659a987cd240b78e45666617248d3d0cc7d64 (patch) | |
| tree | 90b2ed3d59e19de743f14f2677af49b522900578 /src/pretty.rs | |
| parent | 094462cbdda15f19d2dc071b18201f656b8ddcd4 (diff) | |
Rename any template to func template ✏
Diffstat (limited to 'src/pretty.rs')
| -rw-r--r-- | src/pretty.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pretty.rs b/src/pretty.rs index 41fd6d78..e040d3ae 100644 --- a/src/pretty.rs +++ b/src/pretty.rs @@ -128,7 +128,7 @@ impl PrettyWithMap for Node { let value = &map[&(expr as *const _)]; value.pretty(p); } else if let Expr::Call(call) = expr { - // Format function templates appropriately. + // Format bracket functions appropriately. pretty_bracketed(call, p, false) } else { expr.pretty(p); @@ -360,7 +360,7 @@ impl Pretty for ExprCall { } } -/// Pretty print a function template, with body or chaining when possible. +/// Pretty print a bracket function, with body or chaining when possible. pub fn pretty_bracketed(call: &ExprCall, p: &mut Printer, chained: bool) { if chained { p.push_str(" | "); @@ -539,12 +539,12 @@ impl Pretty for TemplateNode { match self { Self::Tree { tree, map } => tree.pretty_with_map(p, Some(map)), Self::Str(s) => p.push_str(s), - Self::Any(any) => any.pretty(p), + Self::Func(func) => func.pretty(p), } } } -impl Pretty for TemplateAny { +impl Pretty for TemplateFunc { fn pretty(&self, p: &mut Printer) { p.push_str("<node "); p.push_str(self.name()); @@ -741,7 +741,7 @@ mod tests { roundtrip("{v(1)}"); roundtrip("{v(a: 1, b)}"); - // Function templates. + // Bracket functions. roundtrip("#[v]"); roundtrip("#[v 1]"); roundtrip("#[v 1, 2][*Ok*]"); @@ -800,7 +800,7 @@ mod tests { tree: Rc::new(vec![Node::Strong]), map: HashMap::new(), }, - TemplateNode::Any(TemplateAny::new("example", |_| {})), + TemplateNode::Func(TemplateFunc::new("example", |_| {})), ], "[*<node example>]", ); |
