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
5e1d4feb
Commit
5e1d4feb
authored
Apr 25, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12 from larsimmisch/master
Remove signed/unsigned warnings
parents
106c682b
b1c20103
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
56 additions
and
64 deletions
+56
-64
context.cpp
context.cpp
+2
-4
context.hpp
context.hpp
+3
-3
eval_apply.cpp
eval_apply.cpp
+10
-11
functions.hpp
functions.hpp
+1
-1
node.cpp
node.cpp
+34
-35
node.hpp
node.hpp
+2
-3
node_comparisons.cpp
node_comparisons.cpp
+2
-3
sass_interface.cpp
sass_interface.cpp
+2
-4
No files found.
context.cpp
View file @
5e1d4feb
...
@@ -52,8 +52,7 @@ namespace Sass {
...
@@ -52,8 +52,7 @@ namespace Sass {
Context
::~
Context
()
Context
::~
Context
()
{
{
int
i
;
for
(
size_t
i
=
0
;
i
<
source_refs
.
size
();
++
i
)
{
for
(
i
=
0
;
i
<
source_refs
.
size
();
++
i
)
{
delete
[]
source_refs
[
i
];
delete
[]
source_refs
[
i
];
}
}
// cerr << "Deallocated " << i << " source string(s)." << endl;
// cerr << "Deallocated " << i << " source string(s)." << endl;
...
@@ -117,4 +116,4 @@ namespace Sass {
...
@@ -117,4 +116,4 @@ namespace Sass {
register_function
(
not_descriptor
,
not_impl
);
register_function
(
not_descriptor
,
not_impl
);
}
}
}
}
\ No newline at end of file
context.hpp
View file @
5e1d4feb
...
@@ -40,14 +40,14 @@ namespace Sass {
...
@@ -40,14 +40,14 @@ namespace Sass {
};
};
struct
Context
{
struct
Context
{
string
sass_path
;
string
css_path
;
vector
<
string
>
include_paths
;
Environment
global_env
;
Environment
global_env
;
map
<
pair
<
string
,
size_t
>
,
Function
>
function_env
;
map
<
pair
<
string
,
size_t
>
,
Function
>
function_env
;
vector
<
char
*>
source_refs
;
// all the source c-strings
vector
<
char
*>
source_refs
;
// all the source c-strings
vector
<
vector
<
Node
>*>
registry
;
// all the child vectors
vector
<
vector
<
Node
>*>
registry
;
// all the child vectors
vector
<
string
>
include_paths
;
size_t
ref_count
;
size_t
ref_count
;
string
sass_path
;
string
css_path
;
void
collect_include_paths
(
const
char
*
paths_str
);
void
collect_include_paths
(
const
char
*
paths_str
);
Context
(
const
char
*
paths_str
=
0
);
Context
(
const
char
*
paths_str
=
0
);
...
...
eval_apply.cpp
View file @
5e1d4feb
...
@@ -45,7 +45,7 @@ namespace Sass {
...
@@ -45,7 +45,7 @@ namespace Sass {
}
break
;
}
break
;
case
Node
:
:
root
:
{
case
Node
:
:
root
:
{
for
(
in
t
i
=
0
;
i
<
expr
.
size
();
++
i
)
{
for
(
size_
t
i
=
0
;
i
<
expr
.
size
();
++
i
)
{
eval
(
expr
[
i
],
env
,
f_env
,
registry
);
eval
(
expr
[
i
],
env
,
f_env
,
registry
);
}
}
return
expr
;
return
expr
;
...
@@ -54,7 +54,7 @@ namespace Sass {
...
@@ -54,7 +54,7 @@ namespace Sass {
case
Node
:
:
block
:
{
case
Node
:
:
block
:
{
Environment
current
;
Environment
current
;
current
.
link
(
env
);
current
.
link
(
env
);
for
(
in
t
i
=
0
;
i
<
expr
.
size
();
++
i
)
{
for
(
size_
t
i
=
0
;
i
<
expr
.
size
();
++
i
)
{
eval
(
expr
[
i
],
current
,
f_env
,
registry
);
eval
(
expr
[
i
],
current
,
f_env
,
registry
);
}
}
return
expr
;
return
expr
;
...
@@ -63,7 +63,7 @@ namespace Sass {
...
@@ -63,7 +63,7 @@ namespace Sass {
case
Node
:
:
assignment
:
{
case
Node
:
:
assignment
:
{
Node
val
(
expr
[
1
]);
Node
val
(
expr
[
1
]);
if
(
val
.
type
==
Node
::
comma_list
||
val
.
type
==
Node
::
space_list
)
{
if
(
val
.
type
==
Node
::
comma_list
||
val
.
type
==
Node
::
space_list
)
{
for
(
in
t
i
=
0
;
i
<
val
.
size
();
++
i
)
{
for
(
size_
t
i
=
0
;
i
<
val
.
size
();
++
i
)
{
if
(
val
[
i
].
eval_me
)
val
[
i
]
=
eval
(
val
[
i
],
env
,
f_env
,
registry
);
if
(
val
[
i
].
eval_me
)
val
[
i
]
=
eval
(
val
[
i
],
env
,
f_env
,
registry
);
}
}
}
}
...
@@ -83,7 +83,7 @@ namespace Sass {
...
@@ -83,7 +83,7 @@ namespace Sass {
case
Node
:
:
rule
:
{
case
Node
:
:
rule
:
{
Node
rhs
(
expr
[
1
]);
Node
rhs
(
expr
[
1
]);
if
(
rhs
.
type
==
Node
::
comma_list
||
rhs
.
type
==
Node
::
space_list
)
{
if
(
rhs
.
type
==
Node
::
comma_list
||
rhs
.
type
==
Node
::
space_list
)
{
for
(
in
t
i
=
0
;
i
<
rhs
.
size
();
++
i
)
{
for
(
size_
t
i
=
0
;
i
<
rhs
.
size
();
++
i
)
{
if
(
rhs
[
i
].
eval_me
)
rhs
[
i
]
=
eval
(
rhs
[
i
],
env
,
f_env
,
registry
);
if
(
rhs
[
i
].
eval_me
)
rhs
[
i
]
=
eval
(
rhs
[
i
],
env
,
f_env
,
registry
);
}
}
}
}
...
@@ -104,7 +104,7 @@ namespace Sass {
...
@@ -104,7 +104,7 @@ namespace Sass {
case
Node
:
:
disjunction
:
{
case
Node
:
:
disjunction
:
{
Node
result
;
Node
result
;
for
(
in
t
i
=
0
;
i
<
expr
.
size
();
++
i
)
{
for
(
size_
t
i
=
0
;
i
<
expr
.
size
();
++
i
)
{
// if (expr[i].type == Node::relation ||
// if (expr[i].type == Node::relation ||
// expr[i].type == Node::function_call && expr[0].content.token.to_string() == "not") {
// expr[i].type == Node::function_call && expr[0].content.token.to_string() == "not") {
result
=
eval
(
expr
[
i
],
env
,
f_env
,
registry
);
result
=
eval
(
expr
[
i
],
env
,
f_env
,
registry
);
...
@@ -116,7 +116,7 @@ namespace Sass {
...
@@ -116,7 +116,7 @@ namespace Sass {
case
Node
:
:
conjunction
:
{
case
Node
:
:
conjunction
:
{
Node
result
;
Node
result
;
for
(
in
t
i
=
0
;
i
<
expr
.
size
();
++
i
)
{
for
(
size_
t
i
=
0
;
i
<
expr
.
size
();
++
i
)
{
result
=
eval
(
expr
[
i
],
env
,
f_env
,
registry
);
result
=
eval
(
expr
[
i
],
env
,
f_env
,
registry
);
if
(
result
.
type
==
Node
::
boolean
&&
result
.
content
.
boolean_value
==
false
)
return
result
;
if
(
result
.
type
==
Node
::
boolean
&&
result
.
content
.
boolean_value
==
false
)
return
result
;
}
}
...
@@ -367,13 +367,13 @@ namespace Sass {
...
@@ -367,13 +367,13 @@ namespace Sass {
Node
body
(
mixin
[
2
].
clone
(
registry
));
Node
body
(
mixin
[
2
].
clone
(
registry
));
Environment
bindings
;
Environment
bindings
;
// bind arguments
// bind arguments
for
(
in
t
i
=
0
,
j
=
0
;
i
<
args
.
size
();
++
i
)
{
for
(
size_
t
i
=
0
,
j
=
0
;
i
<
args
.
size
();
++
i
)
{
if
(
args
[
i
].
type
==
Node
::
assignment
)
{
if
(
args
[
i
].
type
==
Node
::
assignment
)
{
Node
arg
(
args
[
i
]);
Node
arg
(
args
[
i
]);
Token
name
(
arg
[
0
].
content
.
token
);
Token
name
(
arg
[
0
].
content
.
token
);
// check that the keyword arg actually names a formal parameter
// check that the keyword arg actually names a formal parameter
bool
valid_param
=
false
;
bool
valid_param
=
false
;
for
(
in
t
k
=
0
;
k
<
params
.
size
();
++
k
)
{
for
(
size_
t
k
=
0
;
k
<
params
.
size
();
++
k
)
{
Node
param_k
=
params
[
k
];
Node
param_k
=
params
[
k
];
if
(
param_k
.
type
==
Node
::
assignment
)
param_k
=
param_k
[
0
];
if
(
param_k
.
type
==
Node
::
assignment
)
param_k
=
param_k
[
0
];
if
(
arg
[
0
]
==
param_k
)
{
if
(
arg
[
0
]
==
param_k
)
{
...
@@ -421,7 +421,7 @@ namespace Sass {
...
@@ -421,7 +421,7 @@ namespace Sass {
{
{
map
<
Token
,
Node
>
bindings
;
map
<
Token
,
Node
>
bindings
;
// bind arguments
// bind arguments
for
(
in
t
i
=
0
,
j
=
0
;
i
<
args
.
size
();
++
i
)
{
for
(
size_
t
i
=
0
,
j
=
0
;
i
<
args
.
size
();
++
i
)
{
if
(
args
[
i
].
type
==
Node
::
assignment
)
{
if
(
args
[
i
].
type
==
Node
::
assignment
)
{
Node
arg
(
args
[
i
]);
Node
arg
(
args
[
i
]);
Token
name
(
arg
[
0
].
content
.
token
);
Token
name
(
arg
[
0
].
content
.
token
);
...
@@ -436,4 +436,4 @@ namespace Sass {
...
@@ -436,4 +436,4 @@ namespace Sass {
return
f
(
bindings
,
registry
);
return
f
(
bindings
,
registry
);
}
}
}
}
\ No newline at end of file
functions.hpp
View file @
5e1d4feb
...
@@ -30,7 +30,7 @@ namespace Sass {
...
@@ -30,7 +30,7 @@ namespace Sass {
while
(
d
[
len
+
1
])
++
len
;
while
(
d
[
len
+
1
])
++
len
;
parameters
.
reserve
(
len
);
parameters
.
reserve
(
len
);
for
(
in
t
i
=
0
;
i
<
len
;
++
i
)
{
for
(
size_
t
i
=
0
;
i
<
len
;
++
i
)
{
const
char
*
p
=
d
[
i
+
1
];
const
char
*
p
=
d
[
i
+
1
];
Token
name
(
Token
::
make
(
p
,
p
+
std
::
strlen
(
p
)));
Token
name
(
Token
::
make
(
p
,
p
+
std
::
strlen
(
p
)));
parameters
.
push_back
(
name
);
parameters
.
push_back
(
name
);
...
...
node.cpp
View file @
5e1d4feb
This diff is collapsed.
Click to expand it.
node.hpp
View file @
5e1d4feb
...
@@ -190,7 +190,7 @@ namespace Sass {
...
@@ -190,7 +190,7 @@ namespace Sass {
Node
&
operator
+=
(
const
Node
&
n
)
Node
&
operator
+=
(
const
Node
&
n
)
{
{
for
(
in
t
i
=
0
;
i
<
n
.
size
();
++
i
)
{
for
(
size_
t
i
=
0
;
i
<
n
.
size
();
++
i
)
{
content
.
children
->
push_back
(
n
[
i
]);
content
.
children
->
push_back
(
n
[
i
]);
}
}
return
*
this
;
return
*
this
;
...
@@ -278,4 +278,4 @@ namespace Sass {
...
@@ -278,4 +278,4 @@ namespace Sass {
~
Node
()
{
++
destructed
;
}
~
Node
()
{
++
destructed
;
}
};
};
}
}
\ No newline at end of file
node_comparisons.cpp
View file @
5e1d4feb
...
@@ -25,7 +25,7 @@ namespace Sass {
...
@@ -25,7 +25,7 @@ namespace Sass {
case
space_list
:
case
space_list
:
case
expression
:
case
expression
:
case
term
:
{
case
term
:
{
for
(
in
t
i
=
0
;
i
<
size
();
++
i
)
{
for
(
size_
t
i
=
0
;
i
<
size
();
++
i
)
{
if
(
at
(
i
)
==
rhs
[
i
])
continue
;
if
(
at
(
i
)
==
rhs
[
i
])
continue
;
else
return
false
;
else
return
false
;
}
}
...
@@ -101,4 +101,4 @@ namespace Sass {
...
@@ -101,4 +101,4 @@ namespace Sass {
bool
Node
::
operator
>=
(
const
Node
&
rhs
)
const
bool
Node
::
operator
>=
(
const
Node
&
rhs
)
const
{
return
!
(
*
this
<
rhs
);
}
{
return
!
(
*
this
<
rhs
);
}
}
}
\ No newline at end of file
sass_interface.cpp
View file @
5e1d4feb
...
@@ -47,8 +47,7 @@ extern "C" {
...
@@ -47,8 +47,7 @@ extern "C" {
// cerr << "Destructions:\t" << Node::destructed << endl;
// cerr << "Destructions:\t" << Node::destructed << endl;
// cerr << "Registry size:\t" << doc.context.registry.size() << endl;
// cerr << "Registry size:\t" << doc.context.registry.size() << endl;
int
i
;
for
(
size_t
i
=
0
;
i
<
doc
.
context
.
registry
.
size
();
++
i
)
{
for
(
i
=
0
;
i
<
doc
.
context
.
registry
.
size
();
++
i
)
{
delete
doc
.
context
.
registry
[
i
];
delete
doc
.
context
.
registry
[
i
];
}
}
// cerr << "Deallocations:\t" << i << endl;
// cerr << "Deallocations:\t" << i << endl;
...
@@ -133,4 +132,4 @@ extern "C" {
...
@@ -133,4 +132,4 @@ extern "C" {
return
1
;
return
1
;
}
}
}
}
\ 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