summaryrefslogtreecommitdiff
path: root/src/eval/capture.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-05-03 15:58:15 +0200
committerLaurenz <laurmaedje@gmail.com>2022-05-03 15:58:15 +0200
commitd59109e8fffa1d0b03234329e12f5d3e578804e8 (patch)
treefe7453da6f2ae327993e5ca6436ddc6a448a2c41 /src/eval/capture.rs
parentf77f1f61bf05ae506689be3c40252c5807276280 (diff)
Support recursive show rules
Diffstat (limited to 'src/eval/capture.rs')
-rw-r--r--src/eval/capture.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/eval/capture.rs b/src/eval/capture.rs
index 8e54122f..24fc7abc 100644
--- a/src/eval/capture.rs
+++ b/src/eval/capture.rs
@@ -91,8 +91,10 @@ impl<'a> CapturesVisitor<'a> {
// A show rule contains a binding, but that binding is only active
// after the target has been evaluated.
Some(Expr::Show(show)) => {
- self.visit(show.target().as_red());
- self.bind(show.binding());
+ self.visit(show.pattern().as_red());
+ if let Some(binding) = show.binding() {
+ self.bind(binding);
+ }
self.visit(show.body().as_red());
}