Пример #1
0
 protected function _parseAttrList(Line $line)
 {
     while (true) {
         if (!$line->match('([\\w\\-:]+)\\s*')) {
             if ($line[0] == ']') {
                 $line->skip();
                 return;
             }
             throw new Exception('Eror in argument list parsing');
         }
         $name = $line->matches[1];
         if (!$line->match('=\\s*')) {
             $this->_attrs[$name] = true;
             continue;
         }
         if (!$line->match('[\'"]')) {
             if (!$line->match('(.*?)\\s*(\\s|\\])')) {
                 throw new Exception('Eror in argument list parsing');
             }
             $this->_attrs[$name] = $line->matches[1];
             if ($line->matches[2] == ']') {
                 return;
             } else {
                 continue;
             }
         }
         $quote = $line->matches[0];
         break;
     }
 }
Пример #2
0
 protected function _parseTag(Line $line)
 {
     $tag = $line->match('%([\\w\\-:]+)') ? $line->matches[1] : 'div';
     $class = $this->_findTagClass($tag);
     return new $class($line, $tag);
 }