mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00

Conflicts: lib/sass.rb lib/sass/error.rb lib/sass/tree/comment_node.rb lib/sass/tree/debug_node.rb lib/sass/tree/directive_node.rb lib/sass/tree/file_node.rb lib/sass/tree/for_node.rb lib/sass/tree/if_node.rb lib/sass/tree/mixin_def_node.rb lib/sass/tree/mixin_node.rb lib/sass/tree/node.rb lib/sass/tree/while_node.rb
30 lines
726 B
Ruby
30 lines
726 B
Ruby
module Sass
|
|
module Tree
|
|
# A dynamic node representing a Sass `@debug` statement.
|
|
#
|
|
# @see Sass::Tree
|
|
class DebugNode < Node
|
|
# @param expr [Script::Node] The expression to print
|
|
def initialize(expr)
|
|
@expr = expr
|
|
super()
|
|
end
|
|
|
|
protected
|
|
|
|
# Prints the expression to STDERR.
|
|
#
|
|
# @param environment [Sass::Environment] The lexical environment containing
|
|
# variable and mixin values
|
|
def _perform(environment)
|
|
res = @expr.perform(environment)
|
|
if filename
|
|
STDERR.puts "#{filename}:#{line} DEBUG: #{res}"
|
|
else
|
|
STDERR.puts "Line #{line} DEBUG: #{res}"
|
|
end
|
|
[]
|
|
end
|
|
end
|
|
end
|
|
end
|