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
748532bb
Commit
748532bb
authored
Mar 08, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handling empty rules (i.e., extra semicolons, but it's subtle).
parent
a6ae423a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
8 deletions
+6
-8
document_parser.cpp
document_parser.cpp
+3
-6
test.scss
test.scss
+3
-2
No files found.
document_parser.cpp
View file @
748532bb
...
...
@@ -73,7 +73,7 @@ namespace Sass {
lex
<
exactly
<
'{'
>
>
();
bool
semicolon
=
false
;
Node
block
(
line_number
,
Node
::
block
);
while
(
!
lex
<
exactly
<
'}'
>
>
())
{
while
(
!
lex
<
exactly
<
'}'
>
>
())
{
if
(
semicolon
)
{
lex
<
exactly
<
';'
>
>
();
// enforce terminal ';' here
semicolon
=
false
;
...
...
@@ -84,23 +84,20 @@ namespace Sass {
block
<<
Node
(
line_number
,
Node
::
comment
,
lexed
);
block
.
has_rules_or_comments
=
true
;
semicolon
=
true
;
continue
;
}
else
if
(
lex
<
variable
>
())
{
parse_var_def
();
continue
;
}
else
if
(
look_for_rule
(
position
))
{
block
<<
parse_rule
();
block
.
has_rules_or_comments
=
true
;
semicolon
=
true
;
continue
;
}
else
{
else
if
(
!
peek
<
exactly
<
';'
>
>
())
{
block
<<
parse_ruleset
();
block
.
has_rulesets
=
true
;
continue
;
}
else
lex
<
exactly
<
';'
>
>
();
}
return
block
;
// lex< identifier >();
...
...
test.scss
View file @
748532bb
...
...
@@ -13,7 +13,7 @@ div {
text-decoration
:
none
;
/* where will this comment go? */
color
:
green
;
/* what about this comment? */
border
:
1px
$blah
red
;
}
}
;;
/* yet another comment that should be preserved */
display
:
inline-block
;
}
// gone!
...
...
@@ -26,7 +26,8 @@ div {
}
p
{
padding
:
10px
8%
;
-webkit-box-sizing
:
$blux
;
-webkit-box-sizing
:
$blux
;
;
;
;
;
;;;
}
margin
:
10px
5px
;
h1
{
...
...
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