You are here

public static function SassFile::getTree in Sassy 7

* Returns the parse tree for a file. * If caching is enabled a cached version will be used if possible; if not the * parsed file will be cached. *

Parameters

string filename to parse: * @param SassParser Sass parser * @return SassRootNode

1 call to SassFile::getTree()
SassImportNode::parse in phamlp/sass/tree/SassImportNode.php
* Parse this node. * If the node is a CSS import return the CSS import rule. * Else returns the rendered tree for the file. *

File

phamlp/sass/SassFile.php, line 33

Class

SassFile
SassFile class. @package PHamlP @subpackage Sass

Code

public static function getTree($filename, $parser) {
  if ($parser->cache) {
    $cached = self::getCachedFile($filename, $parser->cache_location);
    if ($cached !== false) {
      return $cached;
    }
  }
  $sassParser = new SassParser(array_merge($parser->options, array(
    'line' => 1,
  )));
  $tree = $sassParser
    ->parse($filename);
  if ($parser->cache) {
    self::setCachedFile($tree, $filename, $parser->cache_location);
  }
  return $tree;
}