module Sass::Script
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.
Constants
- CONST_RENAMES
-
@private
- MATCH
-
The regular expression used to parse variables.
- VALIDATE
-
The regular expression used to validate variables without matching.
Public Class Methods
Source
# File 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
@private
Calls superclass method
Source
# File lib/sass/script.rb, line 26 def self.parse(value, line, offset, options = {}) Parser.parse(value, line, offset, options) rescue Sass::SyntaxError => e e.message << ": #{value.inspect}." if e.message == "SassScript error" e.modify_backtrace(:line => line, :filename => options[:filename]) raise e end
Parses a string of SassScript
@param value [String] The SassScript @param line [Integer] The number of the line on which the SassScript appeared.
Used for error reporting
@param offset [Integer] The number of characters in on ‘line` that the SassScript started.
Used for error reporting
@param options [{Symbol => Object}] An options hash;
see {file:SASS_REFERENCE.md#Options the Sass options documentation}
@return [Script::Tree::Node] The root node of the parse tree