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
816020f0
Commit
816020f0
authored
Jul 10, 2012
by
Elliott Sales de Andrade
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Search through include paths when looking for imports.
parent
569baeef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
document_parser.cpp
document_parser.cpp
+10
-12
No files found.
document_parser.cpp
View file @
816020f0
...
...
@@ -101,17 +101,16 @@ namespace Sass {
if
(
!
lex
<
string_constant
>
())
throw_syntax_error
(
"@import directive requires a url or quoted path"
);
// TO DO: BETTER PATH HANDLING
string
import_path
(
lexed
.
unquote
());
const
char
*
curr_path_start
=
path
.
c_str
();
const
char
*
curr_path_end
=
folders
(
curr_path_start
);
string
current_path
(
curr_path_start
,
curr_path_end
-
curr_path_start
);
try
{
Document
importee
(
Document
::
make_from_file
(
context
,
current_path
+
import_path
));
importee
.
parse_scss
();
return
importee
.
root
;
}
catch
(
string
&
path
)
{
throw_read_error
(
"error reading file
\"
"
+
path
+
"
\"
"
);
for
(
vector
<
string
>::
iterator
path
=
context
.
include_paths
.
begin
();
path
<
context
.
include_paths
.
end
();
++
path
)
{
try
{
Document
importee
(
Document
::
make_from_file
(
context
,
*
path
+
import_path
));
importee
.
parse_scss
();
return
importee
.
root
;
}
catch
(
string
&
path
)
{
}
}
throw_read_error
(
"error reading file
\"
"
+
import_path
+
"
\"
"
);
// unreached statement
return
Node
();
}
...
...
@@ -1196,4 +1195,4 @@ namespace Sass {
return
result
;
}
}
\ No newline at end of file
}
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