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
d7502ac1
Commit
d7502ac1
authored
May 28, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing legacy stuff; don't need to pass Node handles by reference anymore.
parent
8e9e6bc8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
eval_apply.cpp
eval_apply.cpp
+7
-4
eval_apply.hpp
eval_apply.hpp
+5
-4
No files found.
eval_apply.cpp
View file @
d7502ac1
...
@@ -17,7 +17,7 @@ namespace Sass {
...
@@ -17,7 +17,7 @@ namespace Sass {
throw
Error
(
Error
::
evaluation
,
path
,
line
,
message
);
throw
Error
(
Error
::
evaluation
,
path
,
line
,
message
);
}
}
Node
eval
(
Node
&
expr
,
Environment
&
env
,
map
<
pair
<
string
,
size_t
>
,
Function
>&
f_env
,
Node_Factory
&
new_Node
,
Context
&
ctx
)
Node
eval
(
Node
expr
,
Environment
&
env
,
map
<
pair
<
string
,
size_t
>
,
Function
>&
f_env
,
Node_Factory
&
new_Node
,
Context
&
ctx
)
{
{
switch
(
expr
.
type
())
switch
(
expr
.
type
())
{
{
...
@@ -47,6 +47,9 @@ namespace Sass {
...
@@ -47,6 +47,9 @@ namespace Sass {
if
(
expr
[
0
].
type
()
==
Node
::
selector_schema
)
{
if
(
expr
[
0
].
type
()
==
Node
::
selector_schema
)
{
expr
[
0
]
=
eval
(
expr
[
0
],
env
,
f_env
,
new_Node
,
ctx
);
expr
[
0
]
=
eval
(
expr
[
0
],
env
,
f_env
,
new_Node
,
ctx
);
}
}
// expand the selector right here and stick it in expr[2]
eval
(
expr
[
1
],
env
,
f_env
,
new_Node
,
ctx
);
eval
(
expr
[
1
],
env
,
f_env
,
new_Node
,
ctx
);
return
expr
;
return
expr
;
}
break
;
}
break
;
...
@@ -286,7 +289,7 @@ namespace Sass {
...
@@ -286,7 +289,7 @@ namespace Sass {
return
expr
;
return
expr
;
}
}
Node
accumulate
(
Node
::
Type
op
,
Node
&
acc
,
Node
&
rhs
,
Node_Factory
&
new_Node
)
Node
accumulate
(
Node
::
Type
op
,
Node
acc
,
Node
rhs
,
Node_Factory
&
new_Node
)
{
{
Node
lhs
(
acc
.
back
());
Node
lhs
(
acc
.
back
());
double
lnum
=
lhs
.
numeric_value
();
double
lnum
=
lhs
.
numeric_value
();
...
@@ -378,7 +381,7 @@ namespace Sass {
...
@@ -378,7 +381,7 @@ namespace Sass {
}
}
}
}
Node
apply_mixin
(
Node
&
mixin
,
const
Node
&
args
,
Environment
&
env
,
map
<
pair
<
string
,
size_t
>
,
Function
>&
f_env
,
Node_Factory
&
new_Node
,
Context
&
ctx
)
Node
apply_mixin
(
Node
mixin
,
const
Node
args
,
Environment
&
env
,
map
<
pair
<
string
,
size_t
>
,
Function
>&
f_env
,
Node_Factory
&
new_Node
,
Context
&
ctx
)
{
{
Node
params
(
mixin
[
1
]);
Node
params
(
mixin
[
1
]);
Node
body
(
new_Node
(
mixin
[
2
]));
// clone the body
Node
body
(
new_Node
(
mixin
[
2
]));
// clone the body
...
@@ -434,7 +437,7 @@ namespace Sass {
...
@@ -434,7 +437,7 @@ namespace Sass {
return
body
;
return
body
;
}
}
Node
apply_function
(
const
Function
&
f
,
const
Node
&
args
,
Environment
&
env
,
map
<
pair
<
string
,
size_t
>
,
Function
>&
f_env
,
Node_Factory
&
new_Node
,
Context
&
ctx
)
Node
apply_function
(
const
Function
&
f
,
const
Node
args
,
Environment
&
env
,
map
<
pair
<
string
,
size_t
>
,
Function
>&
f_env
,
Node_Factory
&
new_Node
,
Context
&
ctx
)
{
{
map
<
Token
,
Node
>
bindings
;
map
<
Token
,
Node
>
bindings
;
// bind arguments
// bind arguments
...
...
eval_apply.hpp
View file @
d7502ac1
...
@@ -11,10 +11,10 @@
...
@@ -11,10 +11,10 @@
namespace
Sass
{
namespace
Sass
{
using
std
::
map
;
using
std
::
map
;
Node
eval
(
Node
&
expr
,
Environment
&
env
,
map
<
pair
<
string
,
size_t
>
,
Function
>&
f_env
,
Node_Factory
&
new_Node
,
Context
&
src_refs
);
Node
eval
(
Node
expr
,
Environment
&
env
,
map
<
pair
<
string
,
size_t
>
,
Function
>&
f_env
,
Node_Factory
&
new_Node
,
Context
&
src_refs
);
Node
accumulate
(
Node
::
Type
op
,
Node
&
acc
,
Node
&
rhs
,
Node_Factory
&
new_Node
);
Node
accumulate
(
Node
::
Type
op
,
Node
acc
,
Node
rhs
,
Node_Factory
&
new_Node
);
double
operate
(
Node
::
Type
op
,
double
lhs
,
double
rhs
);
double
operate
(
Node
::
Type
op
,
double
lhs
,
double
rhs
);
Node
apply_mixin
(
Node
&
mixin
,
const
Node
&
args
,
Environment
&
env
,
map
<
pair
<
string
,
size_t
>
,
Function
>&
f_env
,
Node_Factory
&
new_Node
,
Context
&
src_refs
);
Node
apply_mixin
(
Node
mixin
,
const
Node
args
,
Environment
&
env
,
map
<
pair
<
string
,
size_t
>
,
Function
>&
f_env
,
Node_Factory
&
new_Node
,
Context
&
src_refs
);
Node
apply_function
(
const
Function
&
f
,
const
Node
&
args
,
Environment
&
env
,
map
<
pair
<
string
,
size_t
>
,
Function
>&
f_env
,
Node_Factory
&
new_Node
,
Context
&
src_refs
);
Node
apply_function
(
const
Function
&
f
,
const
Node
args
,
Environment
&
env
,
map
<
pair
<
string
,
size_t
>
,
Function
>&
f_env
,
Node_Factory
&
new_Node
,
Context
&
src_refs
);
}
}
\ No newline at end of file
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