Module Sass::Script
In: lib/sass/script/node.rb
lib/sass/script/number.rb
lib/sass/script/operation.rb
lib/sass/script/literal.rb
lib/sass/script/functions.rb
lib/sass/script/bool.rb
lib/sass/script/color.rb
lib/sass/script/lexer.rb
lib/sass/script/parser.rb
lib/sass/script/variable.rb
lib/sass/script/string.rb
lib/sass/script/funcall.rb
lib/sass/script/unary_operation.rb
lib/sass/script.rb

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.

Methods

parse   resolve  

Classes and Modules

Module Sass::Script::Functions
Class Sass::Script::Bool
Class Sass::Script::Color
Class Sass::Script::Funcall
Class Sass::Script::Lexer
Class Sass::Script::Literal
Class Sass::Script::Node
Class Sass::Script::Number
Class Sass::Script::Operation
Class Sass::Script::Parser
Class Sass::Script::String
Class Sass::Script::UnaryOperation
Class Sass::Script::Variable

Constants

VARIABLE_CHAR = ?!   The character that begins a variable. @private
MATCH = /^!([a-zA-Z_]\w*)\s*((?:\|\|)?=)\s*(.+)/   The regular expression used to parse variables. @private
VALIDATE = /^![a-zA-Z_]\w*$/   The regular expression used to validate variables without matching. @private

Public Class methods

Parses a string of SassScript

@param value [String] The SassScript @param line [Fixnum] The number of the line on which the SassScript appeared.

  Used for error reporting

@param offset [Fixnum] The number of characters in on `line` that the SassScript started.

  Used for error reporting

@param filename [String] The path to the file in which the SassScript appeared.

  Used for error reporting

@return [Script::Node] The root node of the parse tree

[Source]

    # File lib/sass/script.rb, line 50
50:     def self.parse(value, line, offset, filename = nil)
51:       Parser.parse(value, line, offset, filename)
52:     rescue Sass::SyntaxError => e
53:       if e.message == "SassScript error"
54:         e.instance_eval do
55:           @message += ": #{value.dump}."
56:         end
57:       end
58:       e.sass_line = line
59:       raise e
60:     end

Parses and evaluates a string of SassScript.

@param value [String] The SassScript @param line [Fixnum] The number of the line on which the SassScript appeared.

  Used for error reporting

@param offset [Fixnum] The number of characters in on `line` that the SassScript started.

  Used for error reporting

@param environment [Sass::Environment] The environment in which to evaluate the SassScript @return [String] The string result of evaluating the SassScript

[Source]

    # File lib/sass/script.rb, line 36
36:     def self.resolve(value, line, offset, environment)
37:       parse(value, line, offset).perform(environment).to_s
38:     end

[Validate]