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
d0ca3362
Commit
d0ca3362
authored
May 22, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Need a push_front method for Nodes.
parent
f8fb5e2a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
node.hpp
node.hpp
+24
-0
No files found.
node.hpp
View file @
d0ca3362
...
@@ -172,6 +172,7 @@ namespace Sass {
...
@@ -172,6 +172,7 @@ namespace Sass {
Node
&
operator
[](
size_t
i
)
const
;
Node
&
operator
[](
size_t
i
)
const
;
void
pop_back
();
void
pop_back
();
Node
&
push_back
(
Node
n
);
Node
&
push_back
(
Node
n
);
Node
&
push_front
(
Node
n
);
Node
&
operator
<<
(
Node
n
);
Node
&
operator
<<
(
Node
n
);
Node
&
operator
+=
(
Node
n
);
Node
&
operator
+=
(
Node
n
);
...
@@ -246,6 +247,24 @@ namespace Sass {
...
@@ -246,6 +247,24 @@ namespace Sass {
if
(
n
.
has_backref
())
has_backref
=
true
;
if
(
n
.
has_backref
())
has_backref
=
true
;
}
}
void
push_front
(
const
Node
&
n
)
{
children
.
insert
(
children
.
begin
(),
n
);
has_children
=
true
;
switch
(
n
.
type
())
{
case
Node
:
:
comment
:
case
Node
:
:
css_import
:
case
Node
:
:
rule
:
case
Node
:
:
propset
:
has_statements
=
true
;
break
;
case
Node
:
:
ruleset
:
has_blocks
=
true
;
break
;
case
Node
:
:
expansion
:
has_expansions
=
true
;
break
;
case
Node
:
:
backref
:
has_backref
=
true
;
break
;
default
:
break
;
}
if
(
n
.
has_backref
())
has_backref
=
true
;
}
void
pop_back
()
void
pop_back
()
{
children
.
pop_back
();
}
{
children
.
pop_back
();
}
...
@@ -290,6 +309,11 @@ namespace Sass {
...
@@ -290,6 +309,11 @@ namespace Sass {
ip_
->
push_back
(
n
);
ip_
->
push_back
(
n
);
return
*
this
;
return
*
this
;
}
}
inline
Node
&
Node
::
push_front
(
Node
n
)
{
ip_
->
push_front
(
n
);
return
*
this
;
}
inline
Node
&
Node
::
operator
<<
(
Node
n
)
{
return
push_back
(
n
);
}
inline
Node
&
Node
::
operator
<<
(
Node
n
)
{
return
push_back
(
n
);
}
inline
Node
&
Node
::
operator
+=
(
Node
n
)
inline
Node
&
Node
::
operator
+=
(
Node
n
)
{
{
...
...
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