public function getLevel($source)
{
$indent = strlen($source) - strlen(ltrim($source));
$level = $indent / $this->indentSpaces;
if (is_float($level)) {
$level = (int) ceil($level);
}
if (!is_int($level) || preg_match("/[^{$this->indentChar}]/", substr($source, 0, $indent))) {
$this->source = $source;
if ($this->debug) {
throw new SassException('Invalid indentation', $this);
} else {
return 0;
}
}
return $level;
}