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:
- 1492 Bytes
1 | require 'sass/tree/node' |
2 | |
3 | module Sass::Tree |
4 | # A dynamic node representing a Sass `@for` loop. |
5 | # |
6 | # @see Sass::Tree |
7 | class ForNode < Node |
8 | # @param var [String] The name of the loop variable |
9 | # @param from [Script::Node] The parse tree for the initial expression |
10 | # @param to [Script::Node] The parse tree for the final expression |
11 | # @param exclusive [Boolean] Whether to include `to` in the loop |
12 | # or stop just before |
13 | def initialize(var, from, to, exclusive) |
14 | @var = var |
15 | @from = from |
16 | @to = to |
17 | @exclusive = exclusive |
18 | super() |
19 | end |
20 | |
21 | protected |
22 | |
23 | # Runs the child nodes once for each time through the loop, |
24 | # varying the variable each time. |
25 | # |
26 | # @param environment [Sass::Environment] The lexical environment containing |
27 | # variable and mixin values |
28 | # @return [Array<Tree::Node>] The resulting static nodes |
29 | # @see Sass::Tree |
30 | def _perform(environment) |
31 | from = @from.perform(environment) |
32 | to = @to.perform(environment) |
33 | from.assert_int! |
34 | to.assert_int! |
35 | |
36 | to = to.coerce(from.numerator_units, from.denominator_units) |
37 | range = Range.new(from.to_i, to.to_i, @exclusive) |
38 | |
39 | children = [] |
40 | environment = Sass::Environment.new(environment) |
41 | range.each do |i| |
42 | environment.set_local_var(@var, Sass::Script::Number.new(i, from.numerator_units, from.denominator_units)) |
43 | children += perform_children(environment) |
44 | end |
45 | children |
46 | end |
47 | end |
48 | end |