Commit | Line | Data |
---|---|---|
86dbedb6 | 1 | package DX::Step::ConsiderProposition; |
e647e417 | 2 | |
3 | use DX::Class; | |
4 | ||
5 | with 'DX::Role::Step'; | |
6 | ||
ccf0d4fe | 7 | has proposition => (is => 'ro', required => 1); |
8 | ||
e647e417 | 9 | sub apply_to { |
110fd002 | 10 | my ($self, $ss) = @_; |
11 | my $hyp = $ss->current_hypothesis; | |
c75a6803 | 12 | if (my $step = $self->proposition->resolve_for($hyp->scope)) { |
13 | return $ss->but(next_step => $step); | |
14 | } | |
c76de01d | 15 | return $ss->but(next_step => DX::Step::Backtrack->new); |
e647e417 | 16 | } |
17 | ||
18 | 1; |