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
0e87917a
Commit
0e87917a
authored
Mar 27, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clone function for nodes.
parent
c8b93644
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
node.cpp
node.cpp
+25
-0
node.hpp
node.hpp
+2
-0
No files found.
node.cpp
View file @
0e87917a
...
...
@@ -15,6 +15,31 @@ namespace Sass {
size_t
Node
::
fresh
=
0
;
size_t
Node
::
copied
=
0
;
Node
Node
::
clone
()
const
{
Node
n
;
n
.
line_number
=
line_number
;
n
.
token
=
token
;
n
.
numeric_value
=
numeric_value
;
n
.
type
=
type
;
n
.
has_rules_or_comments
=
has_rules_or_comments
;
n
.
has_rulesets
=
has_rulesets
;
n
.
has_propsets
=
has_propsets
;
n
.
has_backref
=
has_backref
;
n
.
from_variable
=
from_variable
;
n
.
eval_me
=
eval_me
;
n
.
is_hex
=
is_hex
;
if
(
children
)
{
n
.
children
=
new
vector
<
Node
>
();
n
.
children
->
reserve
(
size
());
for
(
int
i
=
0
;
i
<
size
();
++
i
)
{
n
<<
at
(
i
);
}
}
++
fresh
;
return
n
;
}
string
Node
::
to_string
(
const
string
&
prefix
)
const
{
switch
(
type
)
...
...
node.hpp
View file @
0e87917a
...
...
@@ -266,6 +266,8 @@ namespace Sass {
void
release
()
const
{
children
=
0
;
}
Node
clone
()
const
;
void
echo
(
stringstream
&
buf
,
size_t
depth
=
0
);
void
emit_nested_css
(
stringstream
&
buf
,
size_t
depth
,
...
...
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