| Class | Sass::Tree::DebugNode |
| In: |
lib/sass/tree/debug_node.rb
|
| Parent: | Node |
A dynamic node representing a Sass `@debug` statement.
@see Sass::Tree
@param expr [Script::Node] The expression to print
# File lib/sass/tree/debug_node.rb, line 8
8: def initialize(expr)
9: @expr = expr
10: super()
11: end
Prints the expression to STDERR.
@param environment [Sass::Environment] The lexical environment containing
variable and mixin values
# File lib/sass/tree/debug_node.rb, line 24
24: def _perform(environment)
25: res = @expr.perform(environment)
26: res = res.value if res.is_a?(Sass::Script::String)
27: if filename
28: $stderr.puts "#{filename}:#{line} DEBUG: #{res}"
29: else
30: $stderr.puts "Line #{line} DEBUG: #{res}"
31: end
32: []
33: end
@see Node#to_src
# File lib/sass/tree/debug_node.rb, line 16
16: def to_src(tabs, opts, fmt)
17: "#{' ' * tabs}@debug #{@expr.to_sass(opts)}#{semi fmt}\n"
18: end