Skip to content

Commit 55abf76

Browse files
committed
Revert "Add configuration for supporting additional extensions as .scss"
This reverts commit 6fe62e9.
1 parent 33718b0 commit 55abf76

File tree

5 files changed

+5
-82
lines changed

5 files changed

+5
-82
lines changed

include/sass/context.h

-3
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,6 @@ ADDAPI size_t ADDCALL sass_compiler_get_callee_stack_size(struct Sass_Compiler*
149149
ADDAPI Sass_Callee_Entry ADDCALL sass_compiler_get_last_callee(struct Sass_Compiler* compiler);
150150
ADDAPI Sass_Callee_Entry ADDCALL sass_compiler_get_callee_entry(struct Sass_Compiler* compiler, size_t idx);
151151

152-
// Push function for import extenions
153-
ADDAPI void ADDCALL sass_option_push_import_extension (struct Sass_Options* options, const char* ext);
154-
155152
// Push function for paths (no manipulation support for now)
156153
ADDAPI void ADDCALL sass_option_push_plugin_path (struct Sass_Options* options, const char* path);
157154
ADDAPI void ADDCALL sass_option_push_include_path (struct Sass_Options* options, const char* path);

src/context.cpp

+2-40
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ namespace Sass {
9696
// include_paths.push_back(CWD);
9797

9898
// collect more paths from different options
99-
collect_extensions(c_options.extension);
100-
collect_extensions(c_options.extensions);
10199
collect_include_paths(c_options.include_path);
102100
collect_include_paths(c_options.include_paths);
103101
collect_plugin_paths(c_options.plugin_path);
@@ -168,37 +166,6 @@ namespace Sass {
168166
{
169167
}
170168

171-
void Context::collect_extensions(const char* exts_str)
172-
{
173-
if (exts_str) {
174-
const char* beg = exts_str;
175-
const char* end = Prelexer::find_first<PATH_SEP>(beg);
176-
177-
while (end) {
178-
std::string ext(beg, end - beg);
179-
if (!ext.empty()) {
180-
extensions.push_back(ext);
181-
}
182-
beg = end + 1;
183-
end = Prelexer::find_first<PATH_SEP>(beg);
184-
}
185-
186-
std::string ext(beg);
187-
if (!ext.empty()) {
188-
extensions.push_back(ext);
189-
}
190-
}
191-
}
192-
193-
void Context::collect_extensions(string_list* paths_array)
194-
{
195-
while (paths_array)
196-
{
197-
collect_extensions(paths_array->string);
198-
paths_array = paths_array->next;
199-
}
200-
}
201-
202169
void Context::collect_include_paths(const char* paths_str)
203170
{
204171
if (paths_str) {
@@ -269,20 +236,15 @@ namespace Sass {
269236
// looks for alternatives and returns a list from one directory
270237
std::vector<Include> Context::find_includes(const Importer& import)
271238
{
272-
// include configured extensions
273-
std::vector<std::string> exts(File::defaultExtensions);
274-
if (extensions.size() > 0) {
275-
exts.insert(exts.end(), extensions.begin(), extensions.end());
276-
}
277239
// make sure we resolve against an absolute path
278240
std::string base_path(rel2abs(import.base_path));
279241
// first try to resolve the load path relative to the base path
280-
std::vector<Include> vec(resolve_includes(base_path, import.imp_path, exts));
242+
std::vector<Include> vec(resolve_includes(base_path, import.imp_path));
281243
// then search in every include path (but only if nothing found yet)
282244
for (size_t i = 0, S = include_paths.size(); vec.size() == 0 && i < S; ++i)
283245
{
284246
// call resolve_includes and individual base path and append all results
285-
std::vector<Include> resolved(resolve_includes(include_paths[i], import.imp_path, exts));
247+
std::vector<Include> resolved(resolve_includes(include_paths[i], import.imp_path));
286248
if (resolved.size()) vec.insert(vec.end(), resolved.begin(), resolved.end());
287249
}
288250
// return vector

src/context.hpp

-3
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ namespace Sass {
6767

6868
std::vector<std::string> plugin_paths; // relative paths to load plugins
6969
std::vector<std::string> include_paths; // lookup paths for includes
70-
std::vector<std::string> extensions; // lookup extensions for imports`
7170

7271

7372

@@ -110,8 +109,6 @@ namespace Sass {
110109
void collect_plugin_paths(string_list* paths_array);
111110
void collect_include_paths(const char* paths_str);
112111
void collect_include_paths(string_list* paths_array);
113-
void collect_extensions(const char* extensions_str);
114-
void collect_extensions(string_list* extensions_array);
115112
std::string format_embedded_source_map();
116113
std::string format_source_mapping_url(const std::string& out_path);
117114

src/sass_context.cpp

+2-32
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@ namespace Sass {
7474
// move line_beg pointer to line start
7575
while (line_beg && *line_beg && lines != 0) {
7676
if (*line_beg == '\n') --lines;
77-
utf8::unchecked::next(line_beg);
77+
utf8::unchecked::next(line_beg);
7878
}
7979
const char* line_end = line_beg;
8080
// move line_end before next newline character
8181
while (line_end && *line_end && *line_end != '\n') {
8282
if (*line_end == '\n') break;
8383
if (*line_end == '\r') break;
84-
utf8::unchecked::next(line_end);
84+
utf8::unchecked::next(line_end);
8585
}
8686
if (line_end && *line_end != 0) ++ line_end;
8787
size_t line_len = line_end - line_beg;
@@ -524,7 +524,6 @@ extern "C" {
524524
options->c_headers = 0;
525525
options->plugin_paths = 0;
526526
options->include_paths = 0;
527-
options->extensions = 0;
528527
}
529528

530529
// helper function, not exported, only accessible locally
@@ -559,18 +558,6 @@ extern "C" {
559558
cur = next;
560559
}
561560
}
562-
// Deallocate extension
563-
if (options->extensions) {
564-
struct string_list* cur;
565-
struct string_list* next;
566-
cur = options->extensions;
567-
while (cur) {
568-
next = cur->next;
569-
free(cur->string);
570-
free(cur);
571-
cur = next;
572-
}
573-
}
574561
// Free options strings
575562
free(options->input_path);
576563
free(options->output_path);
@@ -590,7 +577,6 @@ extern "C" {
590577
options->c_headers = 0;
591578
options->plugin_paths = 0;
592579
options->include_paths = 0;
593-
options->extensions = 0;
594580
}
595581

596582
// helper function, not exported, only accessible locally
@@ -727,22 +713,6 @@ extern "C" {
727713
IMPLEMENT_SASS_CONTEXT_TAKER(char*, source_map_string);
728714
IMPLEMENT_SASS_CONTEXT_TAKER(char**, included_files);
729715

730-
// Push function for import extenions
731-
void ADDCALL sass_option_push_import_extension(struct Sass_Options* options, const char* ext)
732-
{
733-
struct string_list* extension = (struct string_list*) calloc(1, sizeof(struct string_list));
734-
if (extension == 0) return;
735-
extension->string = ext ? sass_copy_c_string(ext) : 0;
736-
struct string_list* last = options->extensions;
737-
if (!options->extensions) {
738-
options->extensions = extension;
739-
} else {
740-
while (last->next)
741-
last = last->next;
742-
last->next = extension;
743-
}
744-
}
745-
746716
// Push function for include paths (no manipulation support for now)
747717
void ADDCALL sass_option_push_include_path(struct Sass_Options* options, const char* path)
748718
{

src/sass_context.hpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,9 @@ struct Sass_Options : Sass_Output_Options {
4040
// Colon-separated list of paths
4141
// Semicolon-separated on Windows
4242
// Maybe use array interface instead?
43-
char* extension;
4443
char* include_path;
4544
char* plugin_path;
4645

47-
// Extensions (linked string list)
48-
struct string_list* extensions;
4946
// Include paths (linked string list)
5047
struct string_list* include_paths;
5148
// Plugin paths (linked string list)
@@ -129,4 +126,4 @@ struct Sass_Compiler {
129126
Sass::Block_Obj root;
130127
};
131128

132-
#endif
129+
#endif

0 commit comments

Comments
 (0)