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
8c8f022e
Commit
8c8f022e
authored
Apr 27, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working on interpolated imports.
parent
c7f07857
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
10 deletions
+27
-10
document_parser.cpp
document_parser.cpp
+18
-6
eval_apply.cpp
eval_apply.cpp
+5
-0
node.cpp
node.cpp
+4
-4
No files found.
document_parser.cpp
View file @
8c8f022e
...
@@ -62,12 +62,24 @@ namespace Sass {
...
@@ -62,12 +62,24 @@ namespace Sass {
lex
<
import
>
();
lex
<
import
>
();
if
(
lex
<
uri_prefix
>
())
if
(
lex
<
uri_prefix
>
())
{
{
const
char
*
beg
=
position
;
if
(
peek
<
string_constant
>
())
{
const
char
*
end
=
find_first
<
exactly
<
')'
>
>
(
position
);
Node
schema
(
parse_string
());
Node
result
(
Node
::
css_import
,
line_number
,
Token
::
make
(
beg
,
end
));
Node
import
(
Node
::
css_import
,
context
.
registry
,
line_number
,
1
);
position
=
end
;
import
<<
schema
;
lex
<
exactly
<
')'
>
>
();
if
(
!
lex
<
exactly
<
')'
>
>
())
syntax_error
(
"unterminated url in @import directive"
);
return
result
;
return
import
;
}
else
{
const
char
*
beg
=
position
;
const
char
*
end
=
find_first
<
exactly
<
')'
>
>
(
position
);
if
(
!
end
)
syntax_error
(
"unterminated url in @import directive"
);
Node
path
(
Node
::
identifier
,
line_number
,
Token
::
make
(
beg
,
end
));
Node
import
(
Node
::
css_import
,
context
.
registry
,
line_number
,
1
);
import
<<
path
;
position
=
end
;
lex
<
exactly
<
')'
>
>
();
return
import
;
}
}
}
if
(
!
lex
<
string_constant
>
())
syntax_error
(
"@import directive requires a url or quoted path"
);
if
(
!
lex
<
string_constant
>
())
syntax_error
(
"@import directive requires a url or quoted path"
);
// TO DO: BETTER PATH HANDLING
// TO DO: BETTER PATH HANDLING
...
...
eval_apply.cpp
View file @
8c8f022e
...
@@ -257,6 +257,11 @@ namespace Sass {
...
@@ -257,6 +257,11 @@ namespace Sass {
return
expr
;
return
expr
;
}
break
;
}
break
;
case
Node
:
:
css_import
:
{
expr
[
0
]
=
eval
(
expr
[
0
],
env
,
f_env
,
registry
);
return
expr
;
}
break
;
default:
{
default:
{
return
expr
;
return
expr
;
}
}
...
...
node.cpp
View file @
8c8f022e
...
@@ -178,7 +178,7 @@ namespace Sass {
...
@@ -178,7 +178,7 @@ namespace Sass {
case
css_import
:
{
case
css_import
:
{
stringstream
ss
;
stringstream
ss
;
ss
<<
"@import url("
;
ss
<<
"@import url("
;
ss
<<
content
.
token
.
to_string
(
);
ss
<<
at
(
0
).
to_string
(
""
);
// cerr << content.token.to_string() << endl;
// cerr << content.token.to_string() << endl;
ss
<<
")"
;
ss
<<
")"
;
return
ss
.
str
();
return
ss
.
str
();
...
@@ -418,7 +418,7 @@ namespace Sass {
...
@@ -418,7 +418,7 @@ namespace Sass {
}
}
for
(
size_t
i
=
0
;
i
<
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
size
();
++
i
)
{
at
(
i
).
emit_nested_css
(
buf
,
depth
,
prefixes
);
at
(
i
).
emit_nested_css
(
buf
,
depth
,
prefixes
);
if
(
at
(
i
).
type
==
css_import
)
buf
<<
endl
;
//
if (at(i).type == css_import) buf << endl;
}
}
break
;
break
;
...
@@ -494,9 +494,9 @@ namespace Sass {
...
@@ -494,9 +494,9 @@ namespace Sass {
break
;
break
;
case
css_import
:
case
css_import
:
buf
<<
endl
<<
string
(
2
*
depth
,
' '
);
buf
<<
string
(
2
*
depth
,
' '
);
buf
<<
to_string
(
""
);
buf
<<
to_string
(
""
);
buf
<<
";"
;
buf
<<
";"
<<
endl
;
break
;
break
;
case
property
:
case
property
:
...
...
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