Class: Sass::Script::Tree::Node
- Inherits:
-
Object
- Object
- Sass::Script::Tree::Node
- Defined in:
- .ruby-sass/lib/sass/script/tree/node.rb
Overview
The abstract superclass for SassScript parse tree nodes.
Use #perform to evaluate a parse tree.
Direct Known Subclasses
Funcall, Interpolation, ListLiteral, Literal, MapLiteral, Operation, Selector, StringInterpolation, UnaryOperation, Variable
Direct Known Subclasses
Funcall, Interpolation, ListLiteral, Literal, MapLiteral, Operation, Selector, StringInterpolation, UnaryOperation, Variable
Instance Attribute Summary (collapse)
-
#filename ⇒ String
The file name of the document on which this node appeared.
-
#line ⇒ Integer
The line of the document on which this node appeared.
-
#options ⇒ {Symbol => Object}
The options hash for this node.
-
#source_range ⇒ Sass::Source::Range
The source range in the document on which this node appeared.
Instance Method Summary (collapse)
-
#children ⇒ Array<Node>
Returns all child nodes of this node.
-
#deep_copy ⇒ Node
Returns a deep clone of this node.
-
#force_division! ⇒ Object
Forces any division operations with number literals in this expression to do real division, rather than returning strings.
-
#perform(environment) ⇒ Sass::Script::Value
Evaluates the node.
-
#to_sass(opts = {}) ⇒ String
Returns the text of this SassScript expression.
Instance Attribute Details
#filename ⇒ String
The file name of the document on which this node appeared.
24 25 26 |
# File '.ruby-sass/lib/sass/script/tree/node.rb', line 24 def filename @filename end |
#line ⇒ Integer
The line of the document on which this node appeared.
14 15 16 |
# File '.ruby-sass/lib/sass/script/tree/node.rb', line 14 def line @line end |
#options ⇒ {Symbol => Object}
The options hash for this node.
9 10 11 |
# File '.ruby-sass/lib/sass/script/tree/node.rb', line 9 def @options end |
#source_range ⇒ Sass::Source::Range
The source range in the document on which this node appeared.
19 20 21 |
# File '.ruby-sass/lib/sass/script/tree/node.rb', line 19 def source_range @source_range end |
Instance Method Details
#children ⇒ Array<Node>
Returns all child nodes of this node.
59 60 61 |
# File '.ruby-sass/lib/sass/script/tree/node.rb', line 59 def children Sass::Util.abstract(self) end |
#deep_copy ⇒ Node
Returns a deep clone of this node. The child nodes are cloned, but options are not.
78 79 80 |
# File '.ruby-sass/lib/sass/script/tree/node.rb', line 78 def deep_copy Sass::Util.abstract(self) end |
#force_division! ⇒ Object
Forces any division operations with number literals in this expression to do real division, rather than returning strings.
84 85 86 |
# File '.ruby-sass/lib/sass/script/tree/node.rb', line 84 def force_division! children.each {|c| c.force_division!} end |
#perform(environment) ⇒ Sass::Script::Value
Evaluates the node.
#perform shouldn't be overridden directly; instead, override #_perform.
49 50 51 52 53 54 |
# File '.ruby-sass/lib/sass/script/tree/node.rb', line 49 def perform(environment) _perform(environment) rescue Sass::SyntaxError => e e.modify_backtrace(:line => line) raise e end |