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:
- 2173 Bytes
1 | module Sass |
2 | # The lexical environment for SassScript. |
3 | # This keeps track of variable and mixin definitions. |
4 | # |
5 | # A new environment is created for each level of Sass nesting. |
6 | # This allows variables to be lexically scoped. |
7 | # The new environment refers to the environment in the upper scope, |
8 | # so it has access to variables defined in enclosing scopes, |
9 | # but new variables are defined locally. |
10 | # |
11 | # Environment also keeps track of the {Engine} options |
12 | # so that they can be made available to {Sass::Script::Functions}. |
13 | class Environment |
14 | # The enclosing environment, |
15 | # or nil if this is the global environment. |
16 | # |
17 | # @return [Environment] |
18 | attr_reader :parent |
19 | attr_writer :options |
20 | |
21 | # @param parent [Environment] See \{#parent} |
22 | def initialize(parent = nil) |
23 | @vars = {} |
24 | @mixins = {} |
25 | @parent = parent |
26 | |
27 | set_var("important", Script::String.new("!important")) unless @parent |
28 | end |
29 | |
30 | # The options hash. |
31 | # See {file:SASS_REFERENCE.md#sass_options the Sass options documentation}. |
32 | # |
33 | # @return [{Symbol => Object}] |
34 | def options |
35 | @options || (parent && parent.options) || {} |
36 | end |
37 | |
38 | class << self |
39 | private |
40 | |
41 | # Note: when updating this, |
42 | # update haml/yard/inherited_hash.rb as well. |
43 | def inherited_hash(name) |
44 | class_eval <<RUBY, __FILE__, __LINE__ + 1 |
45 | def #{name}(name) |
46 | @#{name}s[name] || @parent && @parent.#{name}(name) |
47 | end |
48 | |
49 | def set_#{name}(name, value) |
50 | @#{name}s[name] = value unless try_set_#{name}(name, value) |
51 | end |
52 | |
53 | def try_set_#{name}(name, value) |
54 | if @#{name}s.include?(name) |
55 | @#{name}s[name] = value |
56 | true |
57 | elsif @parent |
58 | @parent.try_set_#{name}(name, value) |
59 | else |
60 | false |
61 | end |
62 | end |
63 | protected :try_set_#{name} |
64 | |
65 | def set_local_#{name}(name, value) |
66 | @#{name}s[name] = value |
67 | end |
68 | RUBY |
69 | end |
70 | end |
71 | |
72 | # variable |
73 | # Script::Literal |
74 | inherited_hash :var |
75 | # mixin |
76 | # Engine::Mixin |
77 | inherited_hash :mixin |
78 | end |
79 | end |