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
2ff087f3
Commit
2ff087f3
authored
Aug 24, 2012
by
Dean Mao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
git://github.com/hcatlin/libsass
parents
90a28428
5107d2b7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
5 deletions
+20
-5
context.cpp
libsass/context.cpp
+2
-1
document.cpp
libsass/document.cpp
+1
-1
functions.cpp
libsass/functions.cpp
+12
-1
functions.hpp
libsass/functions.hpp
+3
-0
node.hpp
libsass/node.hpp
+2
-2
No files found.
libsass/context.cpp
View file @
2ff087f3
...
@@ -60,7 +60,7 @@ namespace Sass {
...
@@ -60,7 +60,7 @@ namespace Sass {
collect_include_paths
(
paths_str
);
collect_include_paths
(
paths_str
);
setup_color_map
();
setup_color_map
();
string
path_string
(
img_path_str
);
string
path_string
(
img_path_str
?
img_path_str
:
""
);
path_string
=
"'"
+
path_string
+
"/'"
;
path_string
=
"'"
+
path_string
+
"/'"
;
image_path
=
new
char
[
path_string
.
length
()
+
1
];
image_path
=
new
char
[
path_string
.
length
()
+
1
];
std
::
strcpy
(
image_path
,
path_string
.
c_str
());
std
::
strcpy
(
image_path
,
path_string
.
c_str
());
...
@@ -158,6 +158,7 @@ namespace Sass {
...
@@ -158,6 +158,7 @@ namespace Sass {
register_function
(
comparable_descriptor
,
comparable
);
register_function
(
comparable_descriptor
,
comparable
);
// Boolean Functions
// Boolean Functions
register_function
(
not_descriptor
,
not_impl
);
register_function
(
not_descriptor
,
not_impl
);
register_function
(
if_descriptor
,
if_impl
);
}
}
void
Context
::
setup_color_map
()
void
Context
::
setup_color_map
()
...
...
libsass/document.cpp
View file @
2ff087f3
...
@@ -67,7 +67,7 @@ namespace Sass {
...
@@ -67,7 +67,7 @@ namespace Sass {
Document
doc
(
ctx
);
Document
doc
(
ctx
);
doc
.
path
=
path
;
doc
.
path
=
path
;
doc
.
line
=
1
;
doc
.
line
=
1
;
doc
.
root
=
ctx
.
new_Node
(
Node
::
root
,
path
,
1
,
0
);
doc
.
root
=
ctx
.
new_Node
(
Node
::
root
,
path
,
1
,
0
);
doc
.
lexed
=
Token
::
make
();
doc
.
lexed
=
Token
::
make
();
doc
.
own_source
=
true
;
doc
.
own_source
=
true
;
...
...
libsass/functions.cpp
View file @
2ff087f3
...
@@ -748,7 +748,7 @@ namespace Sass {
...
@@ -748,7 +748,7 @@ namespace Sass {
// Boolean Functions ///////////////////////////////////////////////////
// Boolean Functions ///////////////////////////////////////////////////
Function_Descriptor
not_descriptor
=
Function_Descriptor
not_descriptor
=
{
"not"
,
"value"
,
0
};
{
"not"
,
"
$
value"
,
0
};
Node
not_impl
(
const
Node
parameters
,
map
<
Token
,
Node
>&
bindings
,
Node_Factory
&
new_Node
)
{
Node
not_impl
(
const
Node
parameters
,
map
<
Token
,
Node
>&
bindings
,
Node_Factory
&
new_Node
)
{
Node
val
(
bindings
[
parameters
[
0
].
token
()]);
Node
val
(
bindings
[
parameters
[
0
].
token
()]);
if
(
val
.
type
()
==
Node
::
boolean
&&
val
.
boolean_value
()
==
false
)
{
if
(
val
.
type
()
==
Node
::
boolean
&&
val
.
boolean_value
()
==
false
)
{
...
@@ -759,5 +759,16 @@ namespace Sass {
...
@@ -759,5 +759,16 @@ namespace Sass {
}
}
}
}
Function_Descriptor
if_descriptor
=
{
"if"
,
"$predicate"
,
"$consequent"
,
"$alternative"
,
0
};
Node
if_impl
(
const
Node
parameters
,
map
<
Token
,
Node
>&
bindings
,
Node_Factory
&
new_Node
)
{
Node
predicate
(
bindings
[
parameters
[
0
].
token
()]);
Node
consequent
(
bindings
[
parameters
[
1
].
token
()]);
Node
alternative
(
bindings
[
parameters
[
2
].
token
()]);
if
(
predicate
.
type
()
==
Node
::
boolean
&&
predicate
.
boolean_value
()
==
false
)
return
alternative
;
return
consequent
;
}
}
}
}
}
libsass/functions.hpp
View file @
2ff087f3
...
@@ -196,6 +196,9 @@ namespace Sass {
...
@@ -196,6 +196,9 @@ namespace Sass {
extern
Function_Descriptor
not_descriptor
;
extern
Function_Descriptor
not_descriptor
;
Node
not_impl
(
const
Node
parameters
,
map
<
Token
,
Node
>&
bindings
,
Node_Factory
&
new_Node
);
Node
not_impl
(
const
Node
parameters
,
map
<
Token
,
Node
>&
bindings
,
Node_Factory
&
new_Node
);
extern
Function_Descriptor
if_descriptor
;
Node
if_impl
(
const
Node
parameters
,
map
<
Token
,
Node
>&
bindings
,
Node_Factory
&
new_Node
);
}
}
}
}
libsass/node.hpp
View file @
2ff087f3
...
@@ -183,8 +183,8 @@ namespace Sass {
...
@@ -183,8 +183,8 @@ namespace Sass {
bool
has_backref
()
const
;
bool
has_backref
()
const
;
bool
from_variable
()
const
;
bool
from_variable
()
const
;
bool
&
should_eval
()
const
;
bool
&
should_eval
()
const
;
bool
&
is_unquoted
()
const
;
bool
&
is_unquoted
()
const
;
// for strings
bool
&
is_quoted
()
const
;
bool
&
is_quoted
()
const
;
// for identifiers
bool
is_numeric
()
const
;
bool
is_numeric
()
const
;
bool
is_guarded
()
const
;
bool
is_guarded
()
const
;
bool
&
has_been_extended
()
const
;
bool
&
has_been_extended
()
const
;
...
...
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