Exemplo n.º 1
0
 function string($string = null)
 {
     if ($string !== null) {
         if (preg_match('/^[><]/m', $string)) {
             // normal rules
             $this->patterns['range'] = '/\\d+.*/';
             $this->patterns['codeblock'] = "/(^([<> ]).*(\n)?)+/m";
         } elseif (preg_match('/^\\*{3}/m', $string)) {
             // context
             $this->patterns['range'] = "/([\\-\\*]{3})[ \t]+\\d+,\\d+[ \t]+\\1.*/";
             $this->patterns['codeblock'] = "/(^([!+ ]).*(\n)?)+/m";
         } else {
             // unified
             $this->patterns['range'] = "/@@.*/";
             $this->patterns['codeblock'] = "/(^([+\\- ]).*(\n)?)+/m";
         }
     }
     return parent::string($string);
 }
Exemplo n.º 2
0
 public function string($str = null)
 {
     if ($str !== null) {
         foreach ($this->child_scanners as $s) {
             $s->string($str);
         }
     }
     return parent::string($str);
 }
Exemplo n.º 3
0
 function string($s = null)
 {
     if ($s !== null) {
         $this->subscanner->string($s);
         $this->php_scanner->string($s);
     }
     return parent::string($s);
 }