class Crass::Parser

def self.stringify(nodes, options = {})


* **:exclude_comments** - When `true`, comments will be excluded.

Options:

original tokenized input.
Converts a node or array of nodes into a CSS string based on their
def self.stringify(nodes, options = {})
  nodes  = [nodes] unless nodes.is_a?(Array)
  string = String.new
  nodes.each do |node|
    next if node.nil?
    case node[:node]
    when :at_rule
      string << '@'
      string << node[:name]
      string << self.stringify(node[:prelude], options)
      if node[:block]
        string << '{' << self.stringify(node[:block], options) << '}'
      else
        string << ';'
      end
    when :comment
      string << node[:raw] unless options[:exclude_comments]
    when :simple_block
      string << node[:start]
      string << self.stringify(node[:value], options)
      string << node[:end]
    when :style_rule
      string << self.stringify(node[:selector][:tokens], options)
      string << '{' << self.stringify(node[:children], options) << '}'
    else
      if node.key?(:raw)
        string << node[:raw]
      elsif node.key?(:tokens)
        string << self.stringify(node[:tokens], options)
      end
    end
  end
  string
end