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-edge-2.3.92 lib/sass/tree/while_node.rb
haml-edge-2.3.91 lib/sass/tree/while_node.rb
haml-edge-2.3.90 lib/sass/tree/while_node.rb
haml-2.2.14 lib/sass/tree/while_node.rb
haml-edge-2.3.89 lib/sass/tree/while_node.rb
haml-edge-2.3.87 lib/sass/tree/while_node.rb
haml-edge-2.3.88 lib/sass/tree/while_node.rb
middleman-0.10.17 vendor/gems/gems/haml-2.2.13/lib/sass/tree/while_node.rb
middleman-0.10.16 vendor/gems/gems/haml-2.2.13/lib/sass/tree/while_node.rb
middleman-0.10.15 vendor/gems/gems/haml-2.2.13/lib/sass/tree/while_node.rb
middleman-0.10.14 vendor/gems/gems/haml-2.2.13/lib/sass/tree/while_node.rb
haml-edge-2.3.86 lib/sass/tree/while_node.rb
haml-edge-2.3.85 lib/sass/tree/while_node.rb
haml-edge-2.3.84 lib/sass/tree/while_node.rb
haml-edge-2.3.83 lib/sass/tree/while_node.rb
haml-edge-2.3.82 lib/sass/tree/while_node.rb
haml-edge-2.3.81 lib/sass/tree/while_node.rb
haml-edge-2.3.80 lib/sass/tree/while_node.rb
haml-edge-2.3.79 lib/sass/tree/while_node.rb
haml-edge-2.3.78 lib/sass/tree/while_node.rb