separate scope setup in rule bodies into its own op
[scpubgit/DKit.git] / lib / DX / RuleSet.pm
index 2ae880d..09a2ff5 100644 (file)
@@ -1,6 +1,7 @@
 package DX::RuleSet;
 
 use Moo;
+use DX::Op::SetupScope;
 use DX::Op::CallRule;
 use DX::Op::MemberOf;
 use DX::Op::ApplyConstraint;
@@ -27,7 +28,7 @@ sub add_rule {
 sub _make_rule {
   my ($self, $vars, @body) = @_;
   my $head = $self->expand_and_link(DX::Op::Return->new, @body);
-  [ $vars, $head ];
+  DX::Op::SetupScope->new(arg_names => $vars, next => $head);
 }
 
 sub expand_and_link {