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:
- 1816 Bytes
1 | require File.join(File.dirname(__FILE__), 'functions') |
2 | module Sass |
3 | module Script |
4 | # A SassScript parse node representing a function call. |
5 | # |
6 | # A function call either calls one of the functions in {Script::Functions}, |
7 | # or if no function with the given name exists |
8 | # it returns a string representation of the function call. |
9 | class Funcall < Node |
10 | # The name of the function. |
11 | # |
12 | # @return [String] |
13 | attr_reader :name |
14 | |
15 | # The arguments to the function. |
16 | # |
17 | # @return [Array<Script::Node>] |
18 | attr_reader :args |
19 | |
20 | # @param name [String] See \{#name} |
21 | # @param name [Array<Script::Node>] See \{#args} |
22 | def initialize(name, args) |
23 | @name = name |
24 | @args = args |
25 | end |
26 | |
27 | # @return [String] A string representation of the function call |
28 | def inspect |
29 | "#{name}(#{args.map {|a| a.inspect}.join(', ')})" |
30 | end |
31 | |
32 | # Evaluates the function call. |
33 | # |
34 | # @param environment [Sass::Environment] The environment in which to evaluate the SassScript |
35 | # @return [Literal] The SassScript object that is the value of the function call |
36 | # @raise [Sass::SyntaxError] if the function call raises an ArgumentError |
37 | def perform(environment) |
38 | args = self.args.map {|a| a.perform(environment)} |
39 | unless Haml::Util.has?(:public_instance_method, Functions, name) && name !~ /^__/ |
40 | return Script::String.new("#{name}(#{args.map {|a| a.perform(environment)}.join(', ')})") |
41 | end |
42 | |
43 | return Functions::EvaluationContext.new(environment.options).send(name, *args) |
44 | rescue ArgumentError => e |
45 | raise e unless e.backtrace.any? {|t| t =~ /:in `(block in )?(#{name}|perform)'$/} |
46 | raise Sass::SyntaxError.new("#{e.message} for `#{name}'") |
47 | end |
48 | end |
49 | end |
50 | end |