public function toTree($source)
{
if ($this->syntax === SassFile::SASS) {
$source = str_replace(array("\r\n", "\n\r", "\r"), "\n", $source);
$this->source = explode("\n", $source);
$this->setIndentChar();
} else {
$this->source = $source;
}
unset($source);
$root = new SassRootNode($this);
$this->buildTree($root);
if ($this->_tokenLevel != 0 && $this->debug) {
if ($this->_tokenLevel < 0) {
$message = 'Too many closing brackets';
} else {
$message = 'One or more missing closing brackets';
}
throw new SassException($message, $this);
}
return $root;
}