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
8995127b
Commit
8995127b
authored
Apr 20, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added '=' and '+' for mixin definition and inclusion, respectively.
parent
205c762a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
4 deletions
+16
-4
input.scss
spec/todo/css_selector_hacks/input.scss
+0
-0
output.css
spec/todo/css_selector_hacks/output.css
+0
-0
document_parser.cpp
src/document_parser.cpp
+16
-4
No files found.
spec/
scss
/css_selector_hacks/input.scss
→
spec/
todo
/css_selector_hacks/input.scss
View file @
8995127b
File moved
spec/
scss
/css_selector_hacks/output.css
→
spec/
todo
/css_selector_hacks/output.css
View file @
8995127b
File moved
src/document_parser.cpp
View file @
8995127b
...
...
@@ -5,6 +5,8 @@
namespace
Sass
{
using
namespace
std
;
extern
const
char
plus_equal
[]
=
"+="
;
void
Document
::
parse_scss
()
{
lex
<
optional_spaces
>
();
...
...
@@ -24,7 +26,7 @@ namespace Sass {
}
if
(
!
lex
<
exactly
<
';'
>
>
())
syntax_error
(
"top-level @import directive must be terminated by ';'"
);
}
else
if
(
peek
<
mixin
>
(
position
))
{
else
if
(
peek
<
mixin
>
(
position
)
||
peek
<
exactly
<
'='
>
>
(
position
)
)
{
root
<<
parse_mixin_definition
();
}
else
if
(
peek
<
include
>
(
position
))
{
...
...
@@ -36,9 +38,14 @@ namespace Sass {
root
<<
parse_assignment
();
if
(
!
lex
<
exactly
<
';'
>
>
())
syntax_error
(
"top-level variable binding must be terminated by ';'"
);
}
else
{
else
if
(
look_for_selector_group
(
position
))
{
root
<<
parse_ruleset
();
}
else
if
(
peek
<
exactly
<
'+'
>
>
())
{
root
<<
parse_mixin_call
();
root
[
0
].
has_expansions
=
true
;
if
(
!
lex
<
exactly
<
';'
>
>
())
syntax_error
(
"top-level @include directive must be terminated by ';'"
);
}
lex
<
optional_spaces
>
();
}
}
...
...
@@ -73,7 +80,7 @@ namespace Sass {
Node
Document
::
parse_mixin_definition
()
{
lex
<
mixin
>
();
lex
<
mixin
>
()
||
lex
<
exactly
<
'='
>
>
()
;
if
(
!
lex
<
identifier
>
())
syntax_error
(
"invalid name in @mixin directive"
);
Node
name
(
Node
::
identifier
,
line_number
,
lexed
);
Node
params
(
parse_mixin_parameters
());
...
...
@@ -118,7 +125,7 @@ namespace Sass {
Node
Document
::
parse_mixin_call
()
{
lex
<
include
>
();
lex
<
include
>
()
||
lex
<
exactly
<
'+'
>
>
()
;
if
(
!
lex
<
identifier
>
())
syntax_error
(
"invalid name in @include directive"
);
Node
name
(
Node
::
identifier
,
line_number
,
lexed
);
Node
args
(
parse_arguments
());
...
...
@@ -469,6 +476,11 @@ namespace Sass {
block
<<
parse_ruleset
(
definition
);
block
[
0
].
has_blocks
=
true
;
}
else
if
(
peek
<
exactly
<
'+'
>
>
())
{
block
<<
parse_mixin_call
();
block
[
0
].
has_expansions
=
true
;
semicolon
=
true
;
}
else
if
(
!
peek
<
exactly
<
';'
>
>
())
{
block
<<
parse_rule
();
block
[
0
].
has_statements
=
true
;
...
...
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