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
34cb35fd
Commit
34cb35fd
authored
Mar 12, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handling selectors that begin with a combinator, since nesting makes them valid and meaningful.
parent
42ee27a6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
3 deletions
+26
-3
document_parser.cpp
document_parser.cpp
+5
-0
node.hpp
node.hpp
+10
-1
selector_groups_and_combinators.scss
selector_groups_and_combinators.scss
+9
-0
input.scss
spec/basic/09_selector_groups_and_combinators/input.scss
+1
-1
output.css
spec/basic/09_selector_groups_and_combinators/output.css
+1
-1
No files found.
document_parser.cpp
View file @
34cb35fd
...
@@ -48,6 +48,11 @@ namespace Sass {
...
@@ -48,6 +48,11 @@ namespace Sass {
Node
Document
::
parse_selector
()
Node
Document
::
parse_selector
()
{
{
Node
selector
(
line_number
,
Node
::
selector
,
1
);
Node
selector
(
line_number
,
Node
::
selector
,
1
);
if
(
lex
<
exactly
<
'+'
>
>
()
||
lex
<
exactly
<
'~'
>
>
()
||
lex
<
exactly
<
'>'
>
>
())
{
selector
<<
Node
(
line_number
,
Node
::
selector_combinator
,
lexed
);
}
selector
<<
parse_simple_selector_sequence
();
selector
<<
parse_simple_selector_sequence
();
while
(
lex
<
exactly
<
'+'
>
>
()
||
while
(
lex
<
exactly
<
'+'
>
>
()
||
lex
<
exactly
<
'~'
>
>
()
||
lex
<
exactly
<
'~'
>
>
()
||
...
...
node.hpp
View file @
34cb35fd
...
@@ -121,7 +121,13 @@ namespace Sass {
...
@@ -121,7 +121,13 @@ namespace Sass {
operator
string
()
{
operator
string
()
{
if
(
type
==
selector
)
{
if
(
type
==
selector
)
{
string
result
(
string
(
children
->
at
(
0
)));
string
result
;
if
(
children
->
at
(
0
).
type
==
selector_combinator
)
{
result
+=
string
(
children
->
at
(
0
).
token
)
+
' '
;
}
else
{
result
+=
string
(
children
->
at
(
0
));
}
for
(
int
i
=
1
;
i
<
children
->
size
();
++
i
)
{
for
(
int
i
=
1
;
i
<
children
->
size
();
++
i
)
{
result
+=
string
(
children
->
at
(
i
));
result
+=
string
(
children
->
at
(
i
));
}
}
...
@@ -131,6 +137,9 @@ namespace Sass {
...
@@ -131,6 +137,9 @@ namespace Sass {
if
(
std
::
isspace
(
token
.
begin
[
0
]))
return
string
(
" "
);
if
(
std
::
isspace
(
token
.
begin
[
0
]))
return
string
(
" "
);
else
return
string
(
" "
)
+=
string
(
token
)
+=
string
(
" "
);
else
return
string
(
" "
)
+=
string
(
token
)
+=
string
(
" "
);
}
}
// else if (type == simple_selector_sequence) {
// return string(" ") += string(token);
// }
else
{
else
{
return
string
(
token
);
return
string
(
token
);
}
}
...
...
selector_groups_and_combinators.scss
0 → 100644
View file @
34cb35fd
a
+
b
,
c
{
blah
:
blah
;
bleh
:
bleh
;
d
e
,
f
~
g
+
h
,
>
i
{
bloo
:
bloo
;
blee
:
blee
;
}
}
\ No newline at end of file
spec/basic/09_selector_groups_and_combinators/input.scss
View file @
34cb35fd
a
+
b
,
c
{
a
+
b
,
c
{
blah
:
blah
;
blah
:
blah
;
bleh
:
bleh
;
bleh
:
bleh
;
d
e
,
f
~
g
+
h
{
d
e
,
f
~
g
+
h
,
>
i
{
bloo
:
bloo
;
bloo
:
bloo
;
blee
:
blee
;
blee
:
blee
;
}
}
...
...
spec/basic/09_selector_groups_and_combinators/output.css
View file @
34cb35fd
a
+
b
,
c
{
a
+
b
,
c
{
blah
:
blah
;
blah
:
blah
;
bleh
:
bleh
;
}
bleh
:
bleh
;
}
a
+
b
d
e
,
a
+
b
f
~
g
+
h
,
c
d
e
,
c
f
~
g
+
h
{
a
+
b
d
e
,
a
+
b
f
~
g
+
h
,
a
+
b
>
i
,
c
d
e
,
c
f
~
g
+
h
,
c
>
i
{
bloo
:
bloo
;
bloo
:
bloo
;
blee
:
blee
;
}
blee
:
blee
;
}
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