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
0259be64
Commit
0259be64
authored
Oct 01, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trying a new expansion/evaluation process. Will hopefully fix some more little bugs.
parent
f7c3321b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
11 deletions
+19
-11
document_parser.cpp
document_parser.cpp
+1
-1
eval_apply.cpp
eval_apply.cpp
+0
-0
eval_apply.hpp
eval_apply.hpp
+2
-1
node.cpp
node.cpp
+2
-0
node.hpp
node.hpp
+8
-3
sass_interface.cpp
sass_interface.cpp
+6
-6
No files found.
document_parser.cpp
View file @
0259be64
...
@@ -598,7 +598,7 @@ namespace Sass {
...
@@ -598,7 +598,7 @@ namespace Sass {
semicolon
=
true
;
semicolon
=
true
;
}
}
else
if
(
lex
<
extend
>
())
{
else
if
(
lex
<
extend
>
())
{
if
(
surrounding_ruleset
.
is_null
_ptr
())
throw_syntax_error
(
"@extend directive may only be used within rules"
);
if
(
surrounding_ruleset
.
is_null
())
throw_syntax_error
(
"@extend directive may only be used within rules"
);
Node
extendee
(
parse_simple_selector_sequence
());
Node
extendee
(
parse_simple_selector_sequence
());
context
.
extensions
.
insert
(
pair
<
Node
,
Node
>
(
extendee
,
surrounding_ruleset
));
context
.
extensions
.
insert
(
pair
<
Node
,
Node
>
(
extendee
,
surrounding_ruleset
));
context
.
has_extensions
=
true
;
context
.
has_extensions
=
true
;
...
...
eval_apply.cpp
View file @
0259be64
This diff is collapsed.
Click to expand it.
eval_apply.hpp
View file @
0259be64
...
@@ -12,7 +12,8 @@
...
@@ -12,7 +12,8 @@
namespace
Sass
{
namespace
Sass
{
using
std
::
map
;
using
std
::
map
;
void
expand
(
Node
expr
,
Node
prefix
,
Environment
&
env
,
map
<
string
,
Function
>&
f_env
,
Node_Factory
&
new_Node
,
Context
&
ctx
,
bool
function_name
=
false
);
Node
eval
(
Node
expr
,
Node
prefix
,
Environment
&
env
,
map
<
string
,
Function
>&
f_env
,
Node_Factory
&
new_Node
,
Context
&
ctx
,
bool
function_name
=
false
);
Node
eval
(
Node
expr
,
Node
prefix
,
Environment
&
env
,
map
<
string
,
Function
>&
f_env
,
Node_Factory
&
new_Node
,
Context
&
ctx
,
bool
function_name
=
false
);
Node
function_eval
(
string
name
,
Node
stm
,
Environment
&
bindings
,
Node_Factory
&
new_Node
,
Context
&
ctx
,
bool
toplevel
=
false
);
Node
function_eval
(
string
name
,
Node
stm
,
Environment
&
bindings
,
Node_Factory
&
new_Node
,
Context
&
ctx
,
bool
toplevel
=
false
);
Node
reduce
(
Node
list
,
size_t
head
,
Node
acc
,
Node_Factory
&
new_Node
);
Node
reduce
(
Node
list
,
size_t
head
,
Node
acc
,
Node_Factory
&
new_Node
);
...
...
node.cpp
View file @
0259be64
...
@@ -20,6 +20,7 @@ namespace Sass {
...
@@ -20,6 +20,7 @@ namespace Sass {
case
block
:
case
block
:
case
expansion
:
case
expansion
:
case
root
:
case
root
:
case
if_directive
:
case
for_through_directive
:
case
for_through_directive
:
case
for_to_directive
:
case
for_to_directive
:
case
each_directive
:
case
each_directive
:
...
@@ -35,6 +36,7 @@ namespace Sass {
...
@@ -35,6 +36,7 @@ namespace Sass {
{
{
case
expansion
:
case
expansion
:
case
block
:
case
block
:
case
if_directive
:
case
for_through_directive
:
case
for_through_directive
:
case
for_to_directive
:
case
for_to_directive
:
case
each_directive
:
case
each_directive
:
...
...
node.hpp
View file @
0259be64
...
@@ -177,8 +177,8 @@ namespace Sass {
...
@@ -177,8 +177,8 @@ namespace Sass {
Node
(
Node_Impl
*
ip
=
0
);
Node
(
Node_Impl
*
ip
=
0
);
Type
type
()
const
;
Type
type
()
const
;
Type
type
(
Type
);
bool
is_none
()
const
;
bool
has_children
()
const
;
bool
has_children
()
const
;
bool
has_statements
()
const
;
bool
has_statements
()
const
;
bool
has_blocks
()
const
;
bool
has_blocks
()
const
;
...
@@ -204,6 +204,7 @@ namespace Sass {
...
@@ -204,6 +204,7 @@ namespace Sass {
Node
&
back
()
const
;
Node
&
back
()
const
;
Node
&
operator
[](
size_t
i
)
const
;
Node
&
operator
[](
size_t
i
)
const
;
void
pop_back
();
void
pop_back
();
void
pop_all
();
Node
&
push_back
(
Node
n
);
Node
&
push_back
(
Node
n
);
Node
&
push_front
(
Node
n
);
Node
&
push_front
(
Node
n
);
Node
&
operator
<<
(
Node
n
);
Node
&
operator
<<
(
Node
n
);
...
@@ -220,7 +221,7 @@ namespace Sass {
...
@@ -220,7 +221,7 @@ namespace Sass {
Token
token
()
const
;
Token
token
()
const
;
Token
unit
()
const
;
Token
unit
()
const
;
bool
is_null
_ptr
()
const
{
return
!
ip_
;
}
bool
is_null
()
const
{
return
!
ip_
;
}
bool
is
(
Node
n
)
const
{
return
ip_
==
n
.
ip_
;
}
bool
is
(
Node
n
)
const
{
return
ip_
==
n
.
ip_
;
}
void
flatten
();
void
flatten
();
...
@@ -413,6 +414,9 @@ namespace Sass {
...
@@ -413,6 +414,9 @@ namespace Sass {
void
pop_back
()
void
pop_back
()
{
children
.
pop_back
();
}
{
children
.
pop_back
();
}
void
pop_all
()
{
for
(
size_t
i
=
0
,
S
=
size
();
i
<
S
;
++
i
)
pop_back
();
}
bool
&
boolean_value
()
bool
&
boolean_value
()
{
return
value
.
boolean
;
}
{
return
value
.
boolean
;
}
...
@@ -430,8 +434,8 @@ namespace Sass {
...
@@ -430,8 +434,8 @@ namespace Sass {
inline
Node
::
Node
(
Node_Impl
*
ip
)
:
ip_
(
ip
)
{
}
inline
Node
::
Node
(
Node_Impl
*
ip
)
:
ip_
(
ip
)
{
}
inline
Node
::
Type
Node
::
type
()
const
{
return
ip_
->
type
;
}
inline
Node
::
Type
Node
::
type
()
const
{
return
ip_
->
type
;
}
inline
Node
::
Type
Node
::
type
(
Type
t
)
{
return
ip_
->
type
=
t
;
}
inline
bool
Node
::
is_none
()
const
{
return
!
ip_
;
}
inline
bool
Node
::
has_children
()
const
{
return
ip_
->
has_children
;
}
inline
bool
Node
::
has_children
()
const
{
return
ip_
->
has_children
;
}
inline
bool
Node
::
has_statements
()
const
{
return
ip_
->
has_statements
;
}
inline
bool
Node
::
has_statements
()
const
{
return
ip_
->
has_statements
;
}
inline
bool
Node
::
has_blocks
()
const
{
return
ip_
->
has_blocks
;
}
inline
bool
Node
::
has_blocks
()
const
{
return
ip_
->
has_blocks
;
}
...
@@ -457,6 +461,7 @@ namespace Sass {
...
@@ -457,6 +461,7 @@ namespace Sass {
inline
Node
&
Node
::
back
()
const
{
return
ip_
->
back
();
}
inline
Node
&
Node
::
back
()
const
{
return
ip_
->
back
();
}
inline
Node
&
Node
::
operator
[](
size_t
i
)
const
{
return
at
(
i
);
}
inline
Node
&
Node
::
operator
[](
size_t
i
)
const
{
return
at
(
i
);
}
inline
void
Node
::
pop_back
()
{
ip_
->
pop_back
();
}
inline
void
Node
::
pop_back
()
{
ip_
->
pop_back
();
}
inline
void
Node
::
pop_all
()
{
ip_
->
pop_all
();
}
inline
Node
&
Node
::
push_back
(
Node
n
)
inline
Node
&
Node
::
push_back
(
Node
n
)
{
{
ip_
->
push_back
(
n
);
ip_
->
push_back
(
n
);
...
...
sass_interface.cpp
View file @
0259be64
...
@@ -41,12 +41,12 @@ extern "C" {
...
@@ -41,12 +41,12 @@ extern "C" {
{
{
using
namespace
Sass
;
using
namespace
Sass
;
doc
.
parse_scss
();
doc
.
parse_scss
();
e
val
(
doc
.
root
,
e
xpand
(
doc
.
root
,
doc
.
context
.
new_Node
(
Node
::
none
,
doc
.
path
,
doc
.
line
,
0
),
doc
.
context
.
new_Node
(
Node
::
none
,
doc
.
path
,
doc
.
line
,
0
),
doc
.
context
.
global_env
,
doc
.
context
.
global_env
,
doc
.
context
.
function_env
,
doc
.
context
.
function_env
,
doc
.
context
.
new_Node
,
doc
.
context
.
new_Node
,
doc
.
context
);
doc
.
context
);
extend_selectors
(
doc
.
context
.
pending_extensions
,
doc
.
context
.
extensions
,
doc
.
context
.
new_Node
);
extend_selectors
(
doc
.
context
.
pending_extensions
,
doc
.
context
.
extensions
,
doc
.
context
.
new_Node
);
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
);
...
...
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