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
bd9aba84
Commit
bd9aba84
authored
Sep 17, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updating the 'compact' built-in so that it works correctly with the newer definition style.
parent
322edca1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
18 deletions
+22
-18
functions.cpp
functions.cpp
+22
-18
No files found.
functions.cpp
View file @
bd9aba84
...
@@ -933,29 +933,33 @@ namespace Sass {
...
@@ -933,29 +933,33 @@ namespace Sass {
extern
Signature
compact_sig
=
"compact($arg1: false, $arg2: false, $arg3: false, $arg4: false, $arg5: false, $arg6: false, $arg7: false, $arg8: false, $arg9: false, $arg10: false, $arg11: false, $arg12: false)"
;
extern
Signature
compact_sig
=
"compact($arg1: false, $arg2: false, $arg3: false, $arg4: false, $arg5: false, $arg6: false, $arg7: false, $arg8: false, $arg9: false, $arg10: false, $arg11: false, $arg12: false)"
;
Node
compact
(
const
Node
parameter_names
,
Environment
&
bindings
,
Node_Factory
&
new_Node
,
string
&
path
,
size_t
line
)
{
Node
compact
(
const
Node
parameter_names
,
Environment
&
bindings
,
Node_Factory
&
new_Node
,
string
&
path
,
size_t
line
)
{
size_t
num_args
=
bindings
.
current_frame
.
size
();
Node
first_arg
(
bindings
[
parameter_names
[
0
].
token
()]);
Node
::
Type
sep_type
=
Node
::
comma_list
;
Node
rest_args
(
new_Node
(
Node
::
comma_list
,
path
,
line
,
0
));
Node
list
;
for
(
size_t
i
=
1
,
S
=
bindings
.
current_frame
.
size
();
i
<
S
;
++
i
)
{
Node
arg1
(
bindings
[
parameter_names
[
0
].
token
()]);
Node
the_arg
(
bindings
[
parameter_names
[
i
].
token
()]);
if
(
num_args
==
1
&&
(
arg1
.
type
()
==
Node
::
space_list
||
if
(
!
the_arg
.
is_false
())
rest_args
<<
new_Node
(
path
,
line
,
the_arg
);
arg1
.
type
()
==
Node
::
comma_list
||
}
arg1
.
type
()
==
Node
::
nil
))
{
if
(
rest_args
.
size
()
>
0
)
{
list
=
new_Node
(
arg1
.
type
(),
path
,
line
,
arg1
.
size
());
Node
result
(
new_Node
(
Node
::
comma_list
,
path
,
line
,
rest_args
.
size
()
+
(
first_arg
.
is_false
()
?
0
:
1
)));
list
+=
arg1
;
if
(
!
first_arg
.
is_false
())
result
<<
new_Node
(
path
,
line
,
first_arg
);
result
+=
rest_args
;
return
result
;
}
}
else
{
else
{
list
=
new_Node
(
sep_type
,
arg1
.
path
(),
arg1
.
line
(),
num_args
);
Node
::
Type
first_type
=
first_arg
.
type
();
for
(
size_t
i
=
0
;
i
<
num_args
;
++
i
)
{
if
(
first_type
==
Node
::
space_list
||
first_type
==
Node
::
comma_list
)
{
list
<<
bindings
[
parameter_names
[
i
].
token
()];
Node
result
(
new_Node
(
first_type
,
path
,
line
,
0
));
for
(
size_t
i
=
0
,
S
=
first_arg
.
size
();
i
<
S
;
++
i
)
{
if
(
!
first_arg
[
i
].
is_false
())
result
<<
new_Node
(
path
,
line
,
first_arg
[
i
]);
}
return
result
;
}
}
}
else
{
Node
new_list
(
new_Node
(
list
.
type
(),
list
.
path
(),
list
.
line
(),
0
));
return
new_Node
(
path
,
line
,
first_arg
);
for
(
size_t
i
=
0
,
S
=
list
.
size
();
i
<
S
;
++
i
)
{
if
((
list
[
i
].
type
()
!=
Node
::
boolean
)
||
list
[
i
].
boolean_value
())
{
new_list
<<
list
[
i
];
}
}
}
}
return
new_list
.
size
()
?
new_list
:
new_Node
(
Node
::
nil
,
path
,
line
,
0
);
// unreachable
return
Node
();
}
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
...
...
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