|
|
|
|
61
|
my $self = shift;
|
61
|
my $self = shift;
|
62
|
my $args = shift;
|
62
|
my $args = shift;
|
63
|
|
63
|
|
|
|
64
|
+ #create an "empty" slave
|
64
|
my $slave = SugarTrail::Template::Slave->new($args);
|
65
|
my $slave = SugarTrail::Template::Slave->new($args);
|
65
|
|
66
|
|
66
|
my @slave_steps;
|
67
|
my @slave_steps;
|
67
|
|
68
|
|
68
|
STEP: foreach my $master_step (@{ $self->{steps} }) {
|
69
|
STEP: foreach my $master_step (@{ $self->{steps} }) {
|
69
|
- my $accept = 1;
|
|
|
|
|
70
|
+ my $accept = 1; # accept by default
|
70
|
my $slave_step = {
|
71
|
my $slave_step = {
|
71
|
line => $master_step->{line},
|
72
|
line => $master_step->{line},
|
72
|
warnings => []
|
73
|
warnings => []
|
73
|
};
|
74
|
};
|
|
|
75
|
+ # test against each condition from the pre-parsed condblock
|
|
|
76
|
+ # if any number of condition warnings is found, accept
|
|
|
77
|
+ # otherwise accept step unless a condition failed
|
74
|
COND: foreach my $condstr (@{ $master_step->{conds} }) {
|
78
|
COND: foreach my $condstr (@{ $master_step->{conds} }) {
|
75
|
my $c = SugarTrail::Template::Condition->new($condstr);
|
79
|
my $c = SugarTrail::Template::Condition->new($condstr);
|
76
|
my ($r, $w) = $c->match($args);
|
80
|
my ($r, $w) = $c->match($args);
|