You are here

public function SassForNode::__construct in Sassy 7.3

Same name and namespace in other branches
  1. 7 phamlp/sass/tree/SassForNode.php \SassForNode::__construct()

SassForNode constructor.

Parameters

object source token:

Return value

SassForNode

Overrides SassNode::__construct

File

phpsass/tree/SassForNode.php, line 65

Class

SassForNode
SassForNode class. Represents a Sass @for loop. @package PHamlP @subpackage Sass.tree

Code

public function __construct($token) {
  parent::__construct($token);
  if (!preg_match(self::MATCH, $token->source, $matches)) {
    throw new SassForNodeException('Invalid @for directive', $this);
  }
  $this->variable = $matches[self::VARIABLE];
  $this->from = $matches[self::FROM];
  $this->to = $matches[self::TO];
  $this->inclusive = $matches[self::INCLUSIVE] === SassForNode::IS_INCLUSIVE;
  $this->step = empty($matches[self::STEP]) ? 1 : $matches[self::STEP];
}