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:
- 1636 Bytes
1 | require 'sass/tree/node' |
2 | |
3 | module Sass::Tree |
4 | # A dynamic node representing a mixin include. |
5 | # |
6 | # @see Sass::Tree |
7 | class MixinNode < Node |
8 | # @param name [String] The name of the mixin |
9 | # @param args [Array<Script::Node>] The arguments to the mixin |
10 | def initialize(name, args) |
11 | @name = name |
12 | @args = args |
13 | super() |
14 | end |
15 | |
16 | protected |
17 | |
18 | # Runs the mixin. |
19 | # |
20 | # @param environment [Sass::Environment] The lexical environment containing |
21 | # variable and mixin values |
22 | # @return [Array<Tree::Node>] The resulting static nodes |
23 | # @raise [Sass::SyntaxError] if there is no mixin with the given name |
24 | # @raise [Sass::SyntaxError] if an incorrect number of arguments was passed |
25 | # @see Sass::Tree |
26 | def _perform(environment) |
27 | raise Sass::SyntaxError.new("Undefined mixin '#{@name}'.", @line) unless mixin = environment.mixin(@name) |
28 | |
29 | raise Sass::SyntaxError.new(<<END.gsub("\n", "")) if mixin.args.size < @args.size |
30 | Mixin #{@name} takes #{mixin.args.size} argument#{'s' if mixin.args.size != 1} |
31 | but #{@args.size} #{@args.size == 1 ? 'was' : 'were'} passed. |
32 | END |
33 | |
34 | environment = mixin.args.zip(@args). |
35 | inject(Sass::Environment.new(mixin.environment)) do |env, ((var, default), value)| |
36 | env.set_local_var(var.name, |
37 | if value |
38 | value.perform(environment) |
39 | elsif default |
40 | default.perform(env) |
41 | end) |
42 | raise Sass::SyntaxError.new("Mixin #{@name} is missing parameter #{var.inspect}.") unless env.var(var.name) |
43 | env |
44 | end |
45 | mixin.tree.map {|c| c.perform(environment)}.flatten |
46 | end |
47 | end |
48 | end |