Module: Sass::Script
- Defined in:
- .ruby-sass/lib/sass/script.rb,
.ruby-sass/lib/sass/script/css_lexer.rb,
.ruby-sass/lib/sass/script/css_parser.rb,
.ruby-sass/lib/sass/script/functions.rb,
.ruby-sass/lib/sass/script/lexer.rb,
.ruby-sass/lib/sass/script/parser.rb
Overview
SassScript is code that's embedded in Sass documents to allow for property values to be computed from variables.
This module contains code that handles the parsing and evaluation of SassScript.
Defined Under Namespace
Modules: Functions, Tree, Value Classes: CssLexer, CssParser, Lexer, Parser
Constant Summary
- MATCH =
The regular expression used to parse variables.
/^\$(#{Sass::SCSS::RX::IDENT})\s*:\s*(.+?) (!#{Sass::SCSS::RX::IDENT}(?:\s+!#{Sass::SCSS::RX::IDENT})*)?$/x
- VALIDATE =
The regular expression used to validate variables without matching.
/^\$#{Sass::SCSS::RX::IDENT}$/
- CONST_RENAMES =
{ :Literal => Sass::Script::Value::Base, :ArgList => Sass::Script::Value::ArgList, :Bool => Sass::Script::Value::Bool, :Color => Sass::Script::Value::Color, :List => Sass::Script::Value::List, :Null => Sass::Script::Value::Null, :Number => Sass::Script::Value::Number, :String => Sass::Script::Value::String, :Node => Sass::Script::Tree::Node, :Funcall => Sass::Script::Tree::Funcall, :Interpolation => Sass::Script::Tree::Interpolation, :Operation => Sass::Script::Tree::Operation, :StringInterpolation => Sass::Script::Tree::StringInterpolation, :UnaryOperation => Sass::Script::Tree::UnaryOperation, :Variable => Sass::Script::Tree::Variable, }
Class Method Summary (collapse)
- .const_missing(name) ⇒ Object
-
.parse(value, line, offset, options = {}) ⇒ Script::Tree::Node
Parses a string of SassScript.
Class Method Details
.const_missing(name) ⇒ Object
59 60 61 62 63 64 |
# File '.ruby-sass/lib/sass/script.rb', line 59 def self.const_missing(name) klass = CONST_RENAMES[name] super unless klass CONST_RENAMES.each {|n, k| const_set(n, k)} klass end |
.parse(value, line, offset, options = {}) ⇒ Script::Tree::Node
Parses a string of SassScript
26 27 28 29 30 31 32 |
# File '.ruby-sass/lib/sass/script.rb', line 26 def self.parse(value, line, offset, = {}) Parser.parse(value, line, offset, ) rescue Sass::SyntaxError => e e. << ": #{value.inspect}." if e. == "SassScript error" e.modify_backtrace(:line => line, :filename => [:filename]) raise e end |