Beispiel #1
0
 /**
  * set text
  */
 function __construct($parser, $line = "")
 {
     parent::__construct();
     if (preg_match('/' . self::REGEX . '/x', $line, $m)) {
         $this->children[] = preg_replace('/[\\\\](.)/x', '\\1', $m[1]);
     }
 }
Beispiel #2
0
 /**
  * insert
  */
 function insert($t)
 {
     // merge inline's
     if (get_class($t) == __CLASS__) {
         foreach ($t->children as $c) {
             $this->children[] = $c;
         }
         return $this;
     } else {
         return parent::insert($t);
     }
 }
Beispiel #3
0
 /**
  * insert node
  *
  * @param NyaaParserToken
  * @return NyaaParserToken 
  */
 public function insert(NyaaParserToken $n)
 {
     $n->setParent($this);
     $this->children[] = $n;
     return $n->last;
 }