Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
node-sass
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
楚学文
node-sass
Commits
96ff864b
Commit
96ff864b
authored
Sep 10, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Converting a few more functions to use the new arg interface. Also using the new node cloner.
parent
7dcab427
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
functions.cpp
functions.cpp
+7
-9
No files found.
functions.cpp
View file @
96ff864b
...
...
@@ -110,6 +110,7 @@ namespace Sass {
return
empty_str
;
}
// Functions for fetching and checking arguments.
static
Node
arg
(
Signature
sig
,
string
&
path
,
size_t
line
,
const
Node
parameter_names
,
Environment
&
bindings
,
size_t
param_num
,
Node
::
Type
param_type
)
{
Node
the_arg
(
bindings
[
parameter_names
[
param_num
].
token
()]);
Node
::
Type
arg_type
=
the_arg
.
type
();
...
...
@@ -183,23 +184,20 @@ namespace Sass {
extern
Signature
red_sig
=
"red($color)"
;
Node
red
(
const
Node
parameter_names
,
Environment
&
bindings
,
Node_Factory
&
new_Node
,
string
&
path
,
size_t
line
)
{
Node
color
(
bindings
[
parameter_names
[
0
].
token
()]);
if
(
color
.
type
()
!=
Node
::
numeric_color
)
throw_eval_error
(
"argument to red must be a color"
,
color
.
path
(),
color
.
line
());
return
color
[
0
];
Node
color
(
arg
(
red_sig
,
path
,
line
,
parameter_names
,
bindings
,
0
,
Node
::
numeric_color
));
return
new_Node
(
path
,
line
,
color
[
0
]);
}
extern
Signature
green_sig
=
"green($color)"
;
Node
green
(
const
Node
parameter_names
,
Environment
&
bindings
,
Node_Factory
&
new_Node
,
string
&
path
,
size_t
line
)
{
Node
color
(
bindings
[
parameter_names
[
0
].
token
()]);
if
(
color
.
type
()
!=
Node
::
numeric_color
)
throw_eval_error
(
"argument to green must be a color"
,
color
.
path
(),
color
.
line
());
return
color
[
1
];
Node
color
(
arg
(
green_sig
,
path
,
line
,
parameter_names
,
bindings
,
0
,
Node
::
numeric_color
));
return
new_Node
(
path
,
line
,
color
[
1
]);
}
extern
Signature
blue_sig
=
"blue($color)"
;
Node
blue
(
const
Node
parameter_names
,
Environment
&
bindings
,
Node_Factory
&
new_Node
,
string
&
path
,
size_t
line
)
{
Node
color
(
bindings
[
parameter_names
[
0
].
token
()]);
if
(
color
.
type
()
!=
Node
::
numeric_color
)
throw_eval_error
(
"argument to blue must be a color"
,
color
.
path
(),
color
.
line
());
return
color
[
2
];
Node
color
(
arg
(
blue_sig
,
path
,
line
,
parameter_names
,
bindings
,
0
,
Node
::
numeric_color
));
return
new_Node
(
path
,
line
,
color
[
2
]);
}
extern
Signature
mix_sig
=
"mix($color-1, $color-2, $weight: 50%)"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment