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
bbd04d5e
Commit
bbd04d5e
authored
May 28, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moving selector expansion into the eval phase. Necessary for inheritance.
parent
d7502ac1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
7 deletions
+29
-7
eval_apply.cpp
eval_apply.cpp
+0
-0
eval_apply.hpp
eval_apply.hpp
+6
-3
sass_interface.cpp
sass_interface.cpp
+6
-1
test_node_factory.cpp
test_node_factory.cpp
+17
-3
No files found.
eval_apply.cpp
View file @
bbd04d5e
This diff is collapsed.
Click to expand it.
eval_apply.hpp
View file @
bbd04d5e
...
@@ -11,10 +11,12 @@
...
@@ -11,10 +11,12 @@
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
,
Node
prefix
,
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
,
Node
prefix
,
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
,
Node
prefix
,
Environment
&
env
,
map
<
pair
<
string
,
size_t
>
,
Function
>&
f_env
,
Node_Factory
&
new_Node
,
Context
&
src_refs
);
Node
expand_selector
(
Node
sel
,
Node
pre
,
Node_Factory
&
new_Node
);
Node
expand_backref
(
Node
sel
,
Node
pre
);
}
}
\ No newline at end of file
sass_interface.cpp
View file @
bbd04d5e
...
@@ -39,7 +39,12 @@ extern "C" {
...
@@ -39,7 +39,12 @@ extern "C" {
{
{
using
namespace
Sass
;
using
namespace
Sass
;
doc
.
parse_scss
();
doc
.
parse_scss
();
eval
(
doc
.
root
,
doc
.
context
.
global_env
,
doc
.
context
.
function_env
,
doc
.
context
.
new_Node
,
doc
.
context
);
eval
(
doc
.
root
,
doc
.
context
.
new_Node
(
Node
::
none
,
doc
.
path
,
doc
.
line
,
0
),
doc
.
context
.
global_env
,
doc
.
context
.
function_env
,
doc
.
context
.
new_Node
,
doc
.
context
);
string
output
(
doc
.
emit_css
(
static_cast
<
Document
::
CSS_Style
>
(
style
)));
string
output
(
doc
.
emit_css
(
static_cast
<
Document
::
CSS_Style
>
(
style
)));
char
*
c_output
=
(
char
*
)
malloc
(
output
.
size
()
+
1
);
char
*
c_output
=
(
char
*
)
malloc
(
output
.
size
()
+
1
);
strcpy
(
c_output
,
output
.
c_str
());
strcpy
(
c_output
,
output
.
c_str
());
...
...
test_node_factory.cpp
View file @
bbd04d5e
#include <iostream>
#include <iostream>
#include <string>
#include <tr1/unordered_map>
#include <map>
#ifndef SASS_NODE_INCLUDED
#ifndef SASS_NODE_INCLUDED
#include "node.hpp"
#include "node.hpp"
...
@@ -60,9 +63,21 @@ int main()
...
@@ -60,9 +63,21 @@ int main()
cout
<<
block2
[
1
][
3
].
numeric_value
()
<<
endl
;
cout
<<
block2
[
1
][
3
].
numeric_value
()
<<
endl
;
block2
[
1
][
3
]
=
new_Node
(
""
,
0
,
.9876
);
block2
[
1
][
3
]
=
new_Node
(
""
,
0
,
.9876
);
cout
<<
block1
[
1
][
3
].
numeric_value
()
<<
endl
;
cout
<<
block1
[
1
][
3
].
numeric_value
()
<<
endl
;
cout
<<
block2
[
1
][
3
].
numeric_value
()
<<
endl
;
cout
<<
block2
[
1
][
3
].
numeric_value
()
<<
endl
<<
endl
;
map
<
Node
,
string
>
dict
;
Node
n
(
new_Node
(
""
,
0
,
42
));
Node
m
(
new_Node
(
""
,
0
,
41
));
dict
[
n
]
=
"hello"
;
dict
[
m
]
=
"goodbye"
;
cout
<<
dict
[
m
]
<<
" "
<<
dict
[
n
]
<<
endl
;
new_Node
.
free
();
new_Node
.
free
();
return
0
;
return
0
;
}
}
\ 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