Module: Sass::Script
- Defined in:
- lib/sass/script.rb,
lib/sass/script/bool.rb,
lib/sass/script/color.rb,
lib/sass/script/lexer.rb,
lib/sass/script/number.rb,
lib/sass/script/parser.rb,
lib/sass/script/string.rb,
lib/sass/script/funcall.rb,
lib/sass/script/variable.rb,
lib/sass/script/functions.rb,
lib/sass/script/operation.rb,
lib/sass/script/unary_operation.rb
Overview
This module contains various SassScript-related functionality.
Defined Under Namespace
Modules: Functions Classes: Bool, Color, Funcall, Lexer, Literal, Number, Operation, Parser, String, UnaryOperation, Variable
Constant Summary collapse
- VARIABLE_CHAR =
:stopdoc: The character that begins a variable.
?!
- MATCH =
The regular expression used to parse variables
/^!(\w+)\s*((?:\|\|)?=)\s*(.+)/
- VALIDATE =
The regular expression used to validate variables without matching
/^!\w+$/
Class Method Summary collapse
- .parse(value, line, offset, filename = nil) ⇒ Object
- .resolve(value, line, offset, environment) ⇒ Object
Class Method Details
.parse(value, line, offset, filename = nil) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/sass/script.rb', line 25 def self.parse(value, line, offset, filename = nil) Parser.parse(value, line, offset, filename) rescue Sass::SyntaxError => e if e. == "SassScript error" e.instance_eval do @message += ": #{value.dump}." end end e.sass_line = line raise e end |
.resolve(value, line, offset, environment) ⇒ Object
21 22 23 |
# File 'lib/sass/script.rb', line 21 def self.resolve(value, line, offset, environment) parse(value, line, offset).perform(environment).to_s end |