Class Sass::Tree::WhileNode
In: lib/sass/tree/while_node.rb
Parent: Node

A dynamic node representing a Sass `@while` loop.

@see Sass::Tree

Methods

_perform   new  

Public Class methods

@param expr [Script::Node] The parse tree for the continue expression

[Source]

    # File lib/sass/tree/while_node.rb, line 9
 9:     def initialize(expr)
10:       @expr = expr
11:       super()
12:     end

Protected Instance methods

Runs the child nodes until the continue expression becomes false.

@param environment [Sass::Environment] The lexical environment containing

  variable and mixin values

@return [Array<Tree::Node>] The resulting static nodes @see Sass::Tree

[Source]

    # File lib/sass/tree/while_node.rb, line 22
22:     def _perform(environment)
23:       children = []
24:       new_environment = Sass::Environment.new(environment)
25:       while @expr.perform(environment).to_bool
26:         children += perform_children(new_environment)
27:       end
28:       children
29:     end

[Validate]