예제 #1
0
 /**
  * ループスタート([)
  */
 protected function commandLoopStart()
 {
     $c = $this->Memory->current();
     if ($c != 0) {
         return null;
     }
     $count = 0;
     $length = mb_strlen($this->command);
     for ($i = $this->position; $i < $length; $i++) {
         if ($this->command[$i] == '[') {
             $count++;
         } elseif ($this->command[$i] == ']') {
             $count--;
             if ($count == 0) {
                 $this->position = $i;
                 break;
             }
         }
     }
 }