mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
[Sass] Recursively set options on Sass::Tree.
This commit is contained in:
parent
a76e1654da
commit
2ba54584f2
4 changed files with 20 additions and 1 deletions
|
@ -122,6 +122,7 @@ module Sass
|
|||
def render_to_tree
|
||||
root = Tree::Node.new(@options)
|
||||
append_children(root, tree(tabulate(@template)).first, true)
|
||||
root.options = @options
|
||||
root
|
||||
end
|
||||
|
||||
|
|
|
@ -9,6 +9,10 @@ module Sass::Tree
|
|||
super(options)
|
||||
end
|
||||
|
||||
def options=(options)
|
||||
@options = options
|
||||
end
|
||||
|
||||
def ==(other)
|
||||
self.value == other.value && super
|
||||
end
|
||||
|
|
|
@ -15,6 +15,11 @@ module Sass::Tree
|
|||
@last_else = node
|
||||
end
|
||||
|
||||
def options=(options)
|
||||
super
|
||||
self.else.options = options if self.else
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def _perform(environment)
|
||||
|
|
|
@ -4,7 +4,7 @@ module Sass
|
|||
attr_accessor :children
|
||||
attr_accessor :line
|
||||
attr_accessor :filename
|
||||
attr_reader :style
|
||||
attr_reader :options
|
||||
|
||||
def initialize(options)
|
||||
@options = options
|
||||
|
@ -12,6 +12,11 @@ module Sass
|
|||
@children = []
|
||||
end
|
||||
|
||||
def options=(options)
|
||||
children.each {|c| c.options = options}
|
||||
@options = options
|
||||
end
|
||||
|
||||
def <<(child)
|
||||
if msg = invalid_child?(child)
|
||||
raise Sass::SyntaxError.new(msg, child.line)
|
||||
|
@ -49,6 +54,10 @@ module Sass
|
|||
raise e
|
||||
end
|
||||
|
||||
def style
|
||||
@options[:style]
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def _perform(environment)
|
||||
|
|
Loading…
Add table
Reference in a new issue