Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 373
- Log:
Initial import of Radiant 0.9.1, which is now packaged as a gem. This is an
import of the tagged 0.9.1 source checked out from GitHub, which isn't quite
the same as the gem distribution - but it doesn't seem to be available in an
archived form and the installed gem already has modifications, so this is
the closest I can get.
- Author:
- rool
- Date:
- Mon Mar 21 13:40:05 +0000 2011
- Size:
- 2240 Bytes
1 | require 'strscan' |
2 | require 'sass/script/node' |
3 | require 'sass/script/variable' |
4 | require 'sass/script/funcall' |
5 | require 'sass/script/operation' |
6 | require 'sass/script/literal' |
7 | require 'sass/script/parser' |
8 | |
9 | module Sass |
10 | # SassScript is code that's embedded in Sass documents |
11 | # to allow for property values to be computed from variables. |
12 | # |
13 | # This module contains code that handles the parsing and evaluation of SassScript. |
14 | module Script |
15 | # The character that begins a variable. |
16 | # @private |
17 | VARIABLE_CHAR = ?! |
18 | |
19 | # The regular expression used to parse variables. |
20 | # @private |
21 | MATCH = /^!([a-zA-Z_]\w*)\s*((?:\|\|)?=)\s*(.+)/ |
22 | |
23 | # The regular expression used to validate variables without matching. |
24 | # @private |
25 | VALIDATE = /^![a-zA-Z_]\w*$/ |
26 | |
27 | # Parses and evaluates a string of SassScript. |
28 | # |
29 | # @param value [String] The SassScript |
30 | # @param line [Fixnum] The number of the line on which the SassScript appeared. |
31 | # Used for error reporting |
32 | # @param offset [Fixnum] The number of characters in on `line` that the SassScript started. |
33 | # Used for error reporting |
34 | # @param environment [Sass::Environment] The environment in which to evaluate the SassScript |
35 | # @return [String] The string result of evaluating the SassScript |
36 | def self.resolve(value, line, offset, environment) |
37 | parse(value, line, offset).perform(environment).to_s |
38 | end |
39 | |
40 | # Parses a string of SassScript |
41 | # |
42 | # @param value [String] The SassScript |
43 | # @param line [Fixnum] The number of the line on which the SassScript appeared. |
44 | # Used for error reporting |
45 | # @param offset [Fixnum] The number of characters in on `line` that the SassScript started. |
46 | # Used for error reporting |
47 | # @param filename [String] The path to the file in which the SassScript appeared. |
48 | # Used for error reporting |
49 | # @return [Script::Node] The root node of the parse tree |
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 |
61 | end |
62 | end |