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
044f397e
Commit
044f397e
authored
Sep 10, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into arg_checking
Conflicts: functions.cpp
parents
49ce9835
169243a3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
0 deletions
+26
-0
functions.cpp
functions.cpp
+0
-0
node_factory.cpp
node_factory.cpp
+24
-0
node_factory.hpp
node_factory.hpp
+2
-0
No files found.
functions.cpp
View file @
044f397e
This diff is collapsed.
Click to expand it.
node_factory.cpp
View file @
044f397e
...
...
@@ -27,6 +27,21 @@ namespace Sass {
return
ip_cpy
;
}
// returns a deep-copy of its argument, but uses the path and line that are passed in
Node_Impl
*
Node_Factory
::
alloc_Node_Impl
(
string
&
path
,
size_t
line
,
Node_Impl
*
ip
)
{
Node_Impl
*
ip_cpy
=
new
Node_Impl
(
*
ip
);
pool_
.
push_back
(
ip_cpy
);
if
(
ip_cpy
->
has_children
)
{
for
(
size_t
i
=
0
,
S
=
ip_cpy
->
size
();
i
<
S
;
++
i
)
{
Node
n
(
ip_cpy
->
at
(
i
));
ip_cpy
->
at
(
i
)
=
(
*
this
)(
path
,
line
,
n
);
}
}
return
ip_cpy
;
}
// for cloning nodes
Node
Node_Factory
::
operator
()(
const
Node
&
n1
)
{
...
...
@@ -34,6 +49,15 @@ namespace Sass {
return
Node
(
ip_cpy
);
}
// for cloning nodes and resetting their path and line-number fields
Node
Node_Factory
::
operator
()(
string
&
path
,
size_t
line
,
const
Node
&
n1
)
{
Node_Impl
*
ip_cpy
=
alloc_Node_Impl
(
path
,
line
,
n1
.
ip_
);
// deep-copy the implementation object
ip_cpy
->
path
=
path
;
ip_cpy
->
line
=
line
;
return
Node
(
ip_cpy
);
}
// for making leaf nodes out of terminals/tokens
Node
Node_Factory
::
operator
()(
Node
::
Type
type
,
string
path
,
size_t
line
,
Token
t
)
{
...
...
node_factory.hpp
View file @
044f397e
...
...
@@ -17,9 +17,11 @@ namespace Sass {
Node_Impl
*
alloc_Node_Impl
(
Node
::
Type
type
,
string
file
,
size_t
line
);
// returns a deep-copy of its argument
Node_Impl
*
alloc_Node_Impl
(
Node_Impl
*
ip
);
Node_Impl
*
alloc_Node_Impl
(
string
&
path
,
size_t
line
,
Node_Impl
*
ip
);
public
:
// for cloning nodes
Node
operator
()(
const
Node
&
n1
);
Node
operator
()(
string
&
path
,
size_t
line
,
const
Node
&
n1
);
// for making leaf nodes out of terminals/tokens
Node
operator
()(
Node
::
Type
type
,
string
file
,
size_t
line
,
Token
t
);
// for making boolean values or interior nodes that have children
...
...
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