Browse Source

Added comments

Alois Mahdal 11 years ago
parent
commit
e2f1b7c0da
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      lib/SugarTrail/Template/Master.pm

+ 5
- 1
lib/SugarTrail/Template/Master.pm View File

@@ -61,16 +61,20 @@ sub generate_slave {
61 61
     my $self = shift;
62 62
     my $args = shift;
63 63
 
64
+    #create an "empty" slave
64 65
     my $slave = SugarTrail::Template::Slave->new($args);
65 66
 
66 67
     my @slave_steps;
67 68
 
68 69
     STEP: foreach my $master_step (@{ $self->{steps} }) {
69
-        my $accept = 1;
70
+        my $accept = 1;     # accept by default
70 71
         my $slave_step = {
71 72
             line        => $master_step->{line},
72 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 78
         COND: foreach my $condstr (@{ $master_step->{conds} }) {
75 79
             my $c = SugarTrail::Template::Condition->new($condstr);
76 80
             my ($r, $w) = $c->match($args);