class SassRootNode in Sassy 7.3
Same name and namespace in other branches
- 7 phamlp/sass/tree/SassRootNode.php \SassRootNode
SassRootNode class. Also the root node of a document. @package PHamlP @subpackage Sass.tree
Hierarchy
- class \SassNode
- class \SassRootNode
Expanded class hierarchy of SassRootNode
File
- phpsass/
tree/ SassRootNode.php, line 21
View source
class SassRootNode extends SassNode {
/**
* @var SassScriptParser SassScript parser
*/
public $script;
/**
* @var SassRenderer the renderer for this node
*/
public $renderer;
/**
* @var SassParser
*/
public $parser;
/**
* @var array extenders for this tree in the form extendee=>extender
*/
public $extenders = array();
/**
* Root SassNode constructor.
* @param SassParser Sass parser
* @return SassNode
*/
public function __construct($parser) {
parent::__construct((object) array(
'source' => '',
'level' => -1,
'filename' => $parser->filename,
'line' => 0,
));
$this->parser = $parser;
$this->script = new SassScriptParser();
$this->renderer = SassRenderer::getRenderer($parser->style);
$this->root = $this;
}
/**
* Parses this node and its children into the render tree.
* Dynamic nodes are evaluated, files imported, etc.
* Only static nodes for rendering are in the resulting tree.
* @param SassContext the context in which this node is parsed
* @return SassNode root node of the render tree
*/
public function parse($context) {
$node = clone $this;
$node->children = $this
->parseChildren($context);
return $node;
}
/**
* Render this node.
* @return string the rendered node
*/
public function render() {
$node = $this
->parse(new SassContext());
$output = '';
foreach ($node->children as $child) {
$output .= $child
->render();
}
// foreach
return $output;
}
public function extend($extendee, $selectors) {
$this->extenders[$extendee] = isset($this->extenders[$extendee]) ? array_merge($this->extenders[$extendee], $selectors) : $selectors;
}
public function getExtenders() {
return $this->extenders;
}
/**
* Returns a value indicating if the line represents this type of node.
* Child classes must override this method.
* @throws SassNodeException if not overriden
*/
public static function isa($line) {
throw new SassNodeException('Child classes must override this method');
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SassNode:: |
public | property | ||
SassNode:: |
public | property | 1 | |
SassNode:: |
public | property | ||
SassNode:: |
public | property | ||
SassNode:: |
public | function | Adds a child to this node. | |
SassNode:: |
public | function | Adds a warning to the node. | |
SassNode:: |
public | function | Evaluates a SassScript expression. | |
SassNode:: |
public | function | Returns the node's children | |
SassNode:: |
public | function | Returns the debug_info option setting for this node | |
SassNode:: |
public | function | Returns the filename for this node | |
SassNode:: |
public | function | Returns the last child node of this node. | |
SassNode:: |
public | function | Returns the level of this node. | |
SassNode:: |
public | function | Returns the line number for this node | |
SassNode:: |
public | function | Returns the line_numbers option setting for this node | |
SassNode:: |
public | function | Returns the node's parent | |
SassNode:: |
public | function | Returns the Sass parser. | |
SassNode:: |
public | function | Returns the property syntax being used. | |
SassNode:: |
public | function | Returns the renderer. | |
SassNode:: |
public | function | Returns the SassScript parser. | |
SassNode:: |
public | function | Returns the source for this node | |
SassNode:: |
public | function | Returns the render style of the document tree. | |
SassNode:: |
public | function | Returns vendor specific properties | |
SassNode:: |
public | function | Returns a value indicating if this node has children | |
SassNode:: |
public | function | Return a value indicating if this node has a parent | |
SassNode:: |
public | function | Returns a value indicating whether this node is in a directive | |
SassNode:: |
public | function | Returns a value indicating whether this node is in a SassScript directive | |
SassNode:: |
public | function | Replace interpolated SassScript contained in '#{}' with the parsed value. | |
SassNode:: |
public | function | Returns a value indicating if this node is a child of the passed node. This just checks the levels of the nodes. If this node is at a greater level than the passed node if is a child of it. | |
SassNode:: |
public | function | Parse the children of the node. | |
SassNode:: |
public | function | Resets children when cloned | |
SassNode:: |
public | function | Getter. | |
SassNode:: |
public | function | Setter. | |
SassRootNode:: |
public | property | ||
SassRootNode:: |
public | property | ||
SassRootNode:: |
public | property | ||
SassRootNode:: |
public | property | ||
SassRootNode:: |
public | function | ||
SassRootNode:: |
public | function | ||
SassRootNode:: |
public static | function |
Returns a value indicating if the line represents this type of node.
Child classes must override this method. Overrides SassNode:: |
|
SassRootNode:: |
public | function | Parses this node and its children into the render tree. Dynamic nodes are evaluated, files imported, etc. Only static nodes for rendering are in the resulting tree. | |
SassRootNode:: |
public | function | Render this node. | |
SassRootNode:: |
public | function |
Root SassNode constructor. Overrides SassNode:: |