Sha256: c64d1a1088056d32b35ee830bee3cf423e4c0f67250073c578ffad7dabd69139

Contents?: true

Size: 833 Bytes

Versions: 206

Compression:

Stored size: 833 Bytes

Contents

require 'sass/tree/node'

module Sass::Tree
  # A dynamic node representing a Sass `@while` loop.
  #
  # @see Sass::Tree
  class WhileNode < Node
    # @param expr [Script::Node] The parse tree for the continue expression
    def initialize(expr)
      @expr = expr
      super()
    end

    protected

    # 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
    def _perform(environment)
      children = []
      new_environment = Sass::Environment.new(environment)
      while @expr.perform(environment).to_bool
        children += perform_children(new_environment)
      end
      children
    end
  end
end

Version data entries

206 entries across 205 versions & 7 rubygems

Version Path
haml-2.2.13 lib/sass/tree/while_node.rb
haml-edge-2.3.77 lib/sass/tree/while_node.rb
haml-edge-2.3.76 lib/sass/tree/while_node.rb
haml-edge-2.3.75 lib/sass/tree/while_node.rb
haml-2.2.12 lib/sass/tree/while_node.rb
haml-edge-2.3.74 lib/sass/tree/while_node.rb
haml-edge-2.3.73 lib/sass/tree/while_node.rb
haml-2.2.11 lib/sass/tree/while_node.rb
haml-edge-2.3.72 lib/sass/tree/while_node.rb
haml-edge-2.3.71 lib/sass/tree/while_node.rb
haml-edge-2.3.70 lib/sass/tree/while_node.rb
haml-edge-2.3.69 lib/sass/tree/while_node.rb
haml-edge-2.3.68 lib/sass/tree/while_node.rb
haml-edge-2.3.67 lib/sass/tree/while_node.rb
haml-edge-2.3.66 lib/sass/tree/while_node.rb
haml-2.2.10 lib/sass/tree/while_node.rb
haml-edge-2.3.65 lib/sass/tree/while_node.rb
haml-edge-2.3.64 lib/sass/tree/while_node.rb
haml-edge-2.3.63 lib/sass/tree/while_node.rb
haml-edge-2.3.62 lib/sass/tree/while_node.rb