瀏覽代碼

Added comments

Alois Mahdal 12 年之前
父節點
當前提交
e2f1b7c0da
共有 1 個檔案被更改,包括 5 行新增1 行删除
  1. 5
    1
      lib/SugarTrail/Template/Master.pm

+ 5
- 1
lib/SugarTrail/Template/Master.pm 查看文件

@@ -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);