Source of file SassCommentNode.php
Size: 1,511 Bytes - Last Modified: 2021-12-23T10:32:55+00:00
/var/www/docs.ssmods.com/process/src/code/phpsass/tree/SassCommentNode.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 | <?php /* SVN FILE: $Id$ */ /** * SassCommentNode class file. * @author Chris Yates <chris.l.yates@gmail.com> * @copyright Copyright (c) 2010 PBM Web Development * @license http://phamlp.googlecode.com/files/license.txt * @package PHamlP * @subpackage Sass.tree */ /** * SassCommentNode class. * Represents a CSS comment. * @package PHamlP * @subpackage Sass.tree */ class SassCommentNode extends SassNode { const NODE_IDENTIFIER = '/'; const MATCH = '%^/\*\s*?(.*?)\s*?(\*/)?$%s'; const COMMENT = 1; private $value; /** * SassCommentNode constructor. * @param object source token * @return CommentNode */ public function __construct($token) { parent::__construct($token); preg_match(self::MATCH, $token->source, $matches); $this->value = $matches[self::COMMENT]; } protected function getValue() { return $this->value; } /** * Parse this node. * @return array the parsed node - an empty array */ public function parse($context) { return array($this); } /** * Render this node. * @return string the rendered node */ public function render() { return $this->renderer->renderComment($this); } /** * Returns a value indicating if the token represents this type of node. * @param object token * @return boolean true if the token represents this type of node, false if not */ public static function isa($token) { return $token->source[0] === self::NODE_IDENTIFIER; } } |