/** * set text */ function __construct($parser, $line = "") { parent::__construct(); if (preg_match('/' . self::REGEX . '/x', $line, $m)) { $this->children[] = preg_replace('/[\\\\](.)/x', '\\1', $m[1]); } }
/** * 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); } }
/** * insert node * * @param NyaaParserToken * @return NyaaParserToken */ public function insert(NyaaParserToken $n) { $n->setParent($this); $this->children[] = $n; return $n->last; }