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:
- 1670 Bytes
1 | require 'set' |
2 | require 'sass/script/string' |
3 | require 'sass/script/number' |
4 | require 'sass/script/color' |
5 | require 'sass/script/functions' |
6 | require 'sass/script/unary_operation' |
7 | |
8 | module Sass::Script |
9 | # A SassScript parse node representing a binary operation, |
10 | # such as `!a + !b` or `"foo" + 1`. |
11 | class Operation < Node |
12 | # @param operand1 [Script::Node] The parse-tree node |
13 | # for the right-hand side of the operator |
14 | # @param operand2 [Script::Node] The parse-tree node |
15 | # for the left-hand side of the operator |
16 | # @param operator [Symbol] The operator to perform. |
17 | # This should be one of the binary operator names in {Lexer::OPERATORS} |
18 | def initialize(operand1, operand2, operator) |
19 | @operand1 = operand1 |
20 | @operand2 = operand2 |
21 | @operator = operator |
22 | end |
23 | |
24 | # @return [String] A human-readable s-expression representation of the operation |
25 | def inspect |
26 | "(#{@operator.inspect} #{@operand1.inspect} #{@operand2.inspect})" |
27 | end |
28 | |
29 | # Evaluates the operation. |
30 | # |
31 | # @param environment [Sass::Environment] The environment in which to evaluate the SassScript |
32 | # @return [Literal] The SassScript object that is the value of the operation |
33 | # @raise [Sass::SyntaxError] if the operation is undefined for the operands |
34 | def perform(environment) |
35 | literal1 = @operand1.perform(environment) |
36 | literal2 = @operand2.perform(environment) |
37 | begin |
38 | literal1.send(@operator, literal2) |
39 | rescue NoMethodError => e |
40 | raise e unless e.name.to_s == @operator.to_s |
41 | raise Sass::SyntaxError.new("Undefined operation: \"#{literal1} #{@operator} #{literal2}\".") |
42 | end |
43 | end |
44 | end |
45 | end |