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
34b40abc
Commit
34b40abc
authored
Jun 22, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Emitting block directives correctly (semantic-wise, anyway). Output of closing braces is a bit off.
parent
89942b12
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
9 deletions
+26
-9
node_emitters.cpp
node_emitters.cpp
+26
-9
No files found.
node_emitters.cpp
View file @
34b40abc
...
...
@@ -367,9 +367,8 @@ namespace Sass {
}
}
break
;
case
ruleset
:
case
block_directive
:
{
Node
sel_group
(
at
(
type
()
==
ruleset
?
2
:
0
));
case
ruleset
:
{
Node
sel_group
(
at
(
2
));
Node
block
(
at
(
1
));
if
(
block
.
has_expansions
())
block
.
flatten
();
...
...
@@ -379,6 +378,7 @@ namespace Sass {
buf
<<
" {"
;
for
(
size_t
i
=
0
,
S
=
block
.
size
();
i
<
S
;
++
i
)
{
Type
stm_type
=
block
[
i
].
type
();
if
(
stm_type
==
block_directive
)
buf
<<
endl
;
switch
(
stm_type
)
{
case
comment
:
...
...
@@ -421,12 +421,29 @@ namespace Sass {
buf
<<
";"
;
}
break
;
// case block_directive: {
// buf << string(2*depth, ' ');
// buf << at(0).to_string() << " {" << endl;
// at(1).emit_nested_css(buf, depth+1, false, false);
// buf << " }" << endl << endl;
// } break;
case
block_directive
:
{
Node
header
(
at
(
0
));
Node
block
(
at
(
1
));
if
(
block
.
has_expansions
())
block
.
flatten
();
buf
<<
string
(
2
*
depth
,
' '
);
buf
<<
header
.
to_string
();
buf
<<
" {"
;
for
(
size_t
i
=
0
,
S
=
block
.
size
();
i
<
S
;
++
i
)
{
switch
(
block
[
i
].
type
())
{
case
ruleset
:
case
media_query
:
case
block_directive
:
buf
<<
endl
;
break
;
default
:
break
;
}
block
[
i
].
emit_nested_css
(
buf
,
depth
+
1
,
false
,
in_media_query
);
}
buf
<<
" }"
<<
endl
;
if
((
depth
==
0
)
&&
at_toplevel
&&
!
in_media_query
)
buf
<<
endl
;
}
break
;
case
propset
:
{
emit_propset
(
buf
,
depth
,
""
);
...
...
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