function CSSDeclarations($endtoken) { $declarations = new CSSDeclarations(); $safe = 100; do { try { $this->whiteSpace(); if ($dec = $this->CSSDeclaration($endtoken)) { if ($this->backslashCommentHack) { $dec->setFilter('hidemac', true); } $declarations->add($dec); } if ($this->isNext(SCOL)) { $this->whiteSpace(); continue; } elseif (!$this->isEof() && !$this->is($endtoken)) { $this->error('trash between declarations?'); } else { break; } } catch (CSSParseError $e) { $this->skipUpTo(SCOL, $endtoken); if ($this->is($endtoken)) { break; } else { $this->nextToken(); } } } while ($safe--); return $declarations; }