Unverified Commit 7929c32e by Michael Mifsud Committed by GitHub

Merge pull request #2543 from sass/libsass-subtreee

Bump LibSass to 3.5.5
parents 9b7015c7 ea9ffd68
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
"object-merge": "^2.5.1", "object-merge": "^2.5.1",
"read-yaml": "^1.0.0", "read-yaml": "^1.0.0",
"rimraf": "^2.5.2", "rimraf": "^2.5.2",
"sass-spec": "3.5.4-1", "sass-spec": "https://github.com/sass/sass-spec.git#dc2d573",
"unique-temp-dir": "^1.0.0" "unique-temp-dir": "^1.0.0"
} }
} }
...@@ -113,7 +113,6 @@ int ExtractOptions(v8::Local<v8::Object> options, void* cptr, sass_context_wrapp ...@@ -113,7 +113,6 @@ int ExtractOptions(v8::Local<v8::Object> options, void* cptr, sass_context_wrapp
sass_option_set_precision(sass_options, Nan::To<int32_t>(Nan::Get(options, Nan::New("precision").ToLocalChecked()).ToLocalChecked()).FromJust()); sass_option_set_precision(sass_options, Nan::To<int32_t>(Nan::Get(options, Nan::New("precision").ToLocalChecked()).ToLocalChecked()).FromJust());
sass_option_set_indent(sass_options, ctx_w->indent); sass_option_set_indent(sass_options, ctx_w->indent);
sass_option_set_linefeed(sass_options, ctx_w->linefeed); sass_option_set_linefeed(sass_options, ctx_w->linefeed);
sass_option_push_import_extension(sass_options, ".css");
v8::Local<v8::Value> importer_callback = Nan::Get(options, Nan::New("importer").ToLocalChecked()).ToLocalChecked(); v8::Local<v8::Value> importer_callback = Nan::Get(options, Nan::New("importer").ToLocalChecked()).ToLocalChecked();
......
...@@ -149,9 +149,6 @@ ADDAPI size_t ADDCALL sass_compiler_get_callee_stack_size(struct Sass_Compiler* ...@@ -149,9 +149,6 @@ ADDAPI size_t ADDCALL sass_compiler_get_callee_stack_size(struct Sass_Compiler*
ADDAPI Sass_Callee_Entry ADDCALL sass_compiler_get_last_callee(struct Sass_Compiler* compiler); ADDAPI Sass_Callee_Entry ADDCALL sass_compiler_get_last_callee(struct Sass_Compiler* compiler);
ADDAPI Sass_Callee_Entry ADDCALL sass_compiler_get_callee_entry(struct Sass_Compiler* compiler, size_t idx); ADDAPI Sass_Callee_Entry ADDCALL sass_compiler_get_callee_entry(struct Sass_Compiler* compiler, size_t idx);
// Push function for import extenions
ADDAPI void ADDCALL sass_option_push_import_extension (struct Sass_Options* options, const char* ext);
// Push function for paths (no manipulation support for now) // Push function for paths (no manipulation support for now)
ADDAPI void ADDCALL sass_option_push_plugin_path (struct Sass_Options* options, const char* path); ADDAPI void ADDCALL sass_option_push_plugin_path (struct Sass_Options* options, const char* path);
ADDAPI void ADDCALL sass_option_push_include_path (struct Sass_Options* options, const char* path); ADDAPI void ADDCALL sass_option_push_include_path (struct Sass_Options* options, const char* path);
......
...@@ -53,8 +53,8 @@ if [ "x$PLUGIN" == "xglob" ]; then ...@@ -53,8 +53,8 @@ if [ "x$PLUGIN" == "xglob" ]; then
${SASSC_BIN} --plugin-path plugins/libsass-${PLUGIN}/build ${SASS_SPEC_SPEC_DIR}/basic/input.scss > ${SASS_SPEC_SPEC_DIR}/basic/result.css ${SASSC_BIN} --plugin-path plugins/libsass-${PLUGIN}/build ${SASS_SPEC_SPEC_DIR}/basic/input.scss > ${SASS_SPEC_SPEC_DIR}/basic/result.css
${SASSC_BIN} --plugin-path plugins/libsass-${PLUGIN}/build ${SASS_SPEC_SPEC_DIR}/basic/input.scss --sourcemap > /dev/null ${SASSC_BIN} --plugin-path plugins/libsass-${PLUGIN}/build ${SASS_SPEC_SPEC_DIR}/basic/input.scss --sourcemap > /dev/null
else else
cat ${SASS_SPEC_SPEC_DIR}/basic/input.scss | ${SASSC_BIN} --plugin-path plugins/libsass-${PLUGIN}/build -I ${SASS_SPEC_SPEC_DIR}/basic > ${SASS_SPEC_SPEC_DIR}/basic/result.css cat ${SASS_SPEC_SPEC_DIR}/basic/input.scss | ${SASSC_BIN} --precision 5 --plugin-path plugins/libsass-${PLUGIN}/build -I ${SASS_SPEC_SPEC_DIR}/basic > ${SASS_SPEC_SPEC_DIR}/basic/result.css
cat ${SASS_SPEC_SPEC_DIR}/basic/input.scss | ${SASSC_BIN} --plugin-path plugins/libsass-${PLUGIN}/build -I ${SASS_SPEC_SPEC_DIR}/basic --sourcemap > /dev/null cat ${SASS_SPEC_SPEC_DIR}/basic/input.scss | ${SASSC_BIN} --precision 5 --plugin-path plugins/libsass-${PLUGIN}/build -I ${SASS_SPEC_SPEC_DIR}/basic --sourcemap > /dev/null
fi fi
RETVAL=$?; if [ "$RETVAL" != "0" ]; then exit $RETVAL; fi RETVAL=$?; if [ "$RETVAL" != "0" ]; then exit $RETVAL; fi
......
...@@ -47,7 +47,7 @@ int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, ...@@ -47,7 +47,7 @@ int base64_encode_block(const char* plaintext_in, int length_in, char* code_out,
*codechar++ = base64_encode_value(result); *codechar++ = base64_encode_value(result);
result = (fragment & 0x003) << 4; result = (fragment & 0x003) << 4;
#ifndef _MSC_VER #ifndef _MSC_VER
__attribute__ ((fallthrough)); /* fall through */
#endif #endif
case step_B: case step_B:
if (plainchar == plaintextend) if (plainchar == plaintextend)
...@@ -61,7 +61,7 @@ int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, ...@@ -61,7 +61,7 @@ int base64_encode_block(const char* plaintext_in, int length_in, char* code_out,
*codechar++ = base64_encode_value(result); *codechar++ = base64_encode_value(result);
result = (fragment & 0x00f) << 2; result = (fragment & 0x00f) << 2;
#ifndef _MSC_VER #ifndef _MSC_VER
__attribute__ ((fallthrough)); /* fall through */
#endif #endif
case step_C: case step_C:
if (plainchar == plaintextend) if (plainchar == plaintextend)
......
...@@ -96,8 +96,6 @@ namespace Sass { ...@@ -96,8 +96,6 @@ namespace Sass {
// include_paths.push_back(CWD); // include_paths.push_back(CWD);
// collect more paths from different options // collect more paths from different options
collect_extensions(c_options.extension);
collect_extensions(c_options.extensions);
collect_include_paths(c_options.include_path); collect_include_paths(c_options.include_path);
collect_include_paths(c_options.include_paths); collect_include_paths(c_options.include_paths);
collect_plugin_paths(c_options.plugin_path); collect_plugin_paths(c_options.plugin_path);
...@@ -168,37 +166,6 @@ namespace Sass { ...@@ -168,37 +166,6 @@ namespace Sass {
{ {
} }
void Context::collect_extensions(const char* exts_str)
{
if (exts_str) {
const char* beg = exts_str;
const char* end = Prelexer::find_first<PATH_SEP>(beg);
while (end) {
std::string ext(beg, end - beg);
if (!ext.empty()) {
extensions.push_back(ext);
}
beg = end + 1;
end = Prelexer::find_first<PATH_SEP>(beg);
}
std::string ext(beg);
if (!ext.empty()) {
extensions.push_back(ext);
}
}
}
void Context::collect_extensions(string_list* paths_array)
{
while (paths_array)
{
collect_extensions(paths_array->string);
paths_array = paths_array->next;
}
}
void Context::collect_include_paths(const char* paths_str) void Context::collect_include_paths(const char* paths_str)
{ {
if (paths_str) { if (paths_str) {
...@@ -269,20 +236,15 @@ namespace Sass { ...@@ -269,20 +236,15 @@ namespace Sass {
// looks for alternatives and returns a list from one directory // looks for alternatives and returns a list from one directory
std::vector<Include> Context::find_includes(const Importer& import) std::vector<Include> Context::find_includes(const Importer& import)
{ {
// include configured extensions
std::vector<std::string> exts(File::defaultExtensions);
if (extensions.size() > 0) {
exts.insert(exts.end(), extensions.begin(), extensions.end());
}
// make sure we resolve against an absolute path // make sure we resolve against an absolute path
std::string base_path(rel2abs(import.base_path)); std::string base_path(rel2abs(import.base_path));
// first try to resolve the load path relative to the base path // first try to resolve the load path relative to the base path
std::vector<Include> vec(resolve_includes(base_path, import.imp_path, exts)); std::vector<Include> vec(resolve_includes(base_path, import.imp_path));
// then search in every include path (but only if nothing found yet) // then search in every include path (but only if nothing found yet)
for (size_t i = 0, S = include_paths.size(); vec.size() == 0 && i < S; ++i) for (size_t i = 0, S = include_paths.size(); vec.size() == 0 && i < S; ++i)
{ {
// call resolve_includes and individual base path and append all results // call resolve_includes and individual base path and append all results
std::vector<Include> resolved(resolve_includes(include_paths[i], import.imp_path, exts)); std::vector<Include> resolved(resolve_includes(include_paths[i], import.imp_path));
if (resolved.size()) vec.insert(vec.end(), resolved.begin(), resolved.end()); if (resolved.size()) vec.insert(vec.end(), resolved.begin(), resolved.end());
} }
// return vector // return vector
...@@ -403,14 +365,6 @@ namespace Sass { ...@@ -403,14 +365,6 @@ namespace Sass {
// process the resolved entry // process the resolved entry
else if (resolved.size() == 1) { else if (resolved.size() == 1) {
bool use_cache = c_importers.size() == 0; bool use_cache = c_importers.size() == 0;
if (resolved[0].deprecated) {
// emit deprecation warning when import resolves to a .css file
deprecated(
"Including .css files with @import is non-standard behaviour which will be removed in future versions of LibSass.",
"Use a custom importer to maintain this behaviour. Check your implementations documentation on how to create a custom importer.",
true, pstate
);
}
// use cache for the resource loading // use cache for the resource loading
if (use_cache && sheets.count(resolved[0].abs_path)) return resolved[0]; if (use_cache && sheets.count(resolved[0].abs_path)) return resolved[0];
// try to read the content of the resolved file entry // try to read the content of the resolved file entry
......
...@@ -67,7 +67,6 @@ namespace Sass { ...@@ -67,7 +67,6 @@ namespace Sass {
std::vector<std::string> plugin_paths; // relative paths to load plugins std::vector<std::string> plugin_paths; // relative paths to load plugins
std::vector<std::string> include_paths; // lookup paths for includes std::vector<std::string> include_paths; // lookup paths for includes
std::vector<std::string> extensions; // lookup extensions for imports`
...@@ -110,8 +109,6 @@ namespace Sass { ...@@ -110,8 +109,6 @@ namespace Sass {
void collect_plugin_paths(string_list* paths_array); void collect_plugin_paths(string_list* paths_array);
void collect_include_paths(const char* paths_str); void collect_include_paths(const char* paths_str);
void collect_include_paths(string_list* paths_array); void collect_include_paths(string_list* paths_array);
void collect_extensions(const char* extensions_str);
void collect_extensions(string_list* extensions_array);
std::string format_embedded_source_map(); std::string format_embedded_source_map();
std::string format_source_mapping_url(const std::string& out_path); std::string format_source_mapping_url(const std::string& out_path);
......
...@@ -342,13 +342,13 @@ namespace Sass { ...@@ -342,13 +342,13 @@ namespace Sass {
for(auto ext : exts) { for(auto ext : exts) {
rel_path = join_paths(base, "_" + name + ext); rel_path = join_paths(base, "_" + name + ext);
abs_path = join_paths(root, rel_path); abs_path = join_paths(root, rel_path);
if (file_exists(abs_path)) includes.push_back({{ rel_path, root }, abs_path, ext == ".css" }); if (file_exists(abs_path)) includes.push_back({{ rel_path, root }, abs_path });
} }
// next test plain name with exts // next test plain name with exts
for(auto ext : exts) { for(auto ext : exts) {
rel_path = join_paths(base, name + ext); rel_path = join_paths(base, name + ext);
abs_path = join_paths(root, rel_path); abs_path = join_paths(root, rel_path);
if (file_exists(abs_path)) includes.push_back({{ rel_path, root }, abs_path, ext == ".css" }); if (file_exists(abs_path)) includes.push_back({{ rel_path, root }, abs_path });
} }
// nothing found // nothing found
return includes; return includes;
......
...@@ -89,14 +89,9 @@ namespace Sass { ...@@ -89,14 +89,9 @@ namespace Sass {
public: public:
// resolved absolute path // resolved absolute path
std::string abs_path; std::string abs_path;
// is a deprecated file type
bool deprecated;
public: public:
Include(const Importer& imp, std::string abs_path, bool deprecated)
: Importer(imp), abs_path(abs_path), deprecated(deprecated)
{ }
Include(const Importer& imp, std::string abs_path) Include(const Importer& imp, std::string abs_path)
: Importer(imp), abs_path(abs_path), deprecated(false) : Importer(imp), abs_path(abs_path)
{ } { }
}; };
...@@ -126,12 +121,11 @@ namespace Sass { ...@@ -126,12 +121,11 @@ namespace Sass {
namespace File { namespace File {
static std::vector<std::string> defaultExtensions = { ".scss", ".sass" }; static std::vector<std::string> defaultExtensions = { ".scss", ".sass", ".css" };
std::vector<Include> resolve_includes(const std::string& root, const std::string& file, std::vector<Include> resolve_includes(const std::string& root, const std::string& file,
const std::vector<std::string>& exts = defaultExtensions); const std::vector<std::string>& exts = defaultExtensions);
} }
} }
......
...@@ -1057,7 +1057,7 @@ namespace Sass { ...@@ -1057,7 +1057,7 @@ namespace Sass {
case Complex_Selector::REFERENCE: case Complex_Selector::REFERENCE:
append_mandatory_space(); append_mandatory_space();
append_string("/"); append_string("/");
c->reference()->perform(this); if (c->reference()) c->reference()->perform(this);
append_string("/"); append_string("/");
append_mandatory_space(); append_mandatory_space();
break; break;
......
...@@ -54,6 +54,22 @@ namespace Sass { ...@@ -54,6 +54,22 @@ namespace Sass {
bool lte(Expression_Obj lhs, Expression_Obj rhs) { return cmp(lhs, rhs, Sass_OP::LTE) || eq(lhs, rhs); } bool lte(Expression_Obj lhs, Expression_Obj rhs) { return cmp(lhs, rhs, Sass_OP::LTE) || eq(lhs, rhs); }
bool gte(Expression_Obj lhs, Expression_Obj rhs) { return !cmp(lhs, rhs, Sass_OP::GTE) || eq(lhs, rhs); } bool gte(Expression_Obj lhs, Expression_Obj rhs) { return !cmp(lhs, rhs, Sass_OP::GTE) || eq(lhs, rhs); }
/* colour math deprecation warning */
void op_color_deprecation(enum Sass_OP op, std::string lsh, std::string rhs, const ParserState& pstate)
{
std::string op_str(
op == Sass_OP::ADD ? "plus" :
op == Sass_OP::DIV ? "div" :
op == Sass_OP::SUB ? "minus" :
op == Sass_OP::MUL ? "times" : ""
);
std::string msg("The operation `" + lsh + " " + op_str + " " + rhs + "` is deprecated and will be an error in future versions.");
std::string tail("Consider using Sass's color functions instead.\nhttp://sass-lang.com/documentation/Sass/Script/Functions.html#other_color_functions");
deprecated(msg, tail, false, pstate);
}
/* static function, throws OperationError, has no traces but optional pstate for returned value */ /* static function, throws OperationError, has no traces but optional pstate for returned value */
Value_Ptr op_strings(Sass::Operand operand, Value& lhs, Value& rhs, struct Sass_Inspect_Options opt, const ParserState& pstate, bool delayed) Value_Ptr op_strings(Sass::Operand operand, Value& lhs, Value& rhs, struct Sass_Inspect_Options opt, const ParserState& pstate, bool delayed)
{ {
...@@ -107,12 +123,16 @@ namespace Sass { ...@@ -107,12 +123,16 @@ namespace Sass {
/* static function, throws OperationError, has no traces but optional pstate for returned value */ /* static function, throws OperationError, has no traces but optional pstate for returned value */
Value_Ptr op_colors(enum Sass_OP op, const Color& lhs, const Color& rhs, struct Sass_Inspect_Options opt, const ParserState& pstate, bool delayed) Value_Ptr op_colors(enum Sass_OP op, const Color& lhs, const Color& rhs, struct Sass_Inspect_Options opt, const ParserState& pstate, bool delayed)
{ {
if (lhs.a() != rhs.a()) { if (lhs.a() != rhs.a()) {
throw Exception::AlphaChannelsNotEqual(&lhs, &rhs, op); throw Exception::AlphaChannelsNotEqual(&lhs, &rhs, op);
} }
if (op == Sass_OP::DIV && (!rhs.r() || !rhs.g() || !rhs.b())) { if ((op == Sass_OP::DIV || op == Sass_OP::MOD) && (!rhs.r() || !rhs.g() || !rhs.b())) {
throw Exception::ZeroDivisionError(lhs, rhs); throw Exception::ZeroDivisionError(lhs, rhs);
} }
op_color_deprecation(op, lhs.to_string(), rhs.to_string(), pstate);
return SASS_MEMORY_NEW(Color, return SASS_MEMORY_NEW(Color,
pstate, pstate,
ops[op](lhs.r(), rhs.r()), ops[op](lhs.r(), rhs.r()),
...@@ -195,9 +215,11 @@ namespace Sass { ...@@ -195,9 +215,11 @@ namespace Sass {
Value_Ptr op_number_color(enum Sass_OP op, const Number& lhs, const Color& rhs, struct Sass_Inspect_Options opt, const ParserState& pstate, bool delayed) Value_Ptr op_number_color(enum Sass_OP op, const Number& lhs, const Color& rhs, struct Sass_Inspect_Options opt, const ParserState& pstate, bool delayed)
{ {
double lval = lhs.value(); double lval = lhs.value();
switch (op) { switch (op) {
case Sass_OP::ADD: case Sass_OP::ADD:
case Sass_OP::MUL: { case Sass_OP::MUL: {
op_color_deprecation(op, lhs.to_string(), rhs.to_string(opt), pstate);
return SASS_MEMORY_NEW(Color, return SASS_MEMORY_NEW(Color,
pstate, pstate,
ops[op](lval, rhs.r()), ops[op](lval, rhs.r()),
...@@ -208,6 +230,7 @@ namespace Sass { ...@@ -208,6 +230,7 @@ namespace Sass {
case Sass_OP::SUB: case Sass_OP::SUB:
case Sass_OP::DIV: { case Sass_OP::DIV: {
std::string color(rhs.to_string(opt)); std::string color(rhs.to_string(opt));
op_color_deprecation(op, lhs.to_string(), color, pstate);
return SASS_MEMORY_NEW(String_Quoted, return SASS_MEMORY_NEW(String_Quoted,
pstate, pstate,
lhs.to_string(opt) lhs.to_string(opt)
...@@ -223,10 +246,14 @@ namespace Sass { ...@@ -223,10 +246,14 @@ namespace Sass {
Value_Ptr op_color_number(enum Sass_OP op, const Color& lhs, const Number& rhs, struct Sass_Inspect_Options opt, const ParserState& pstate, bool delayed) Value_Ptr op_color_number(enum Sass_OP op, const Color& lhs, const Number& rhs, struct Sass_Inspect_Options opt, const ParserState& pstate, bool delayed)
{ {
double rval = rhs.value(); double rval = rhs.value();
if (op == Sass_OP::DIV && rval == 0) {
if ((op == Sass_OP::DIV || op == Sass_OP::DIV) && rval == 0) {
// comparison of Fixnum with Float failed? // comparison of Fixnum with Float failed?
throw Exception::ZeroDivisionError(lhs, rhs); throw Exception::ZeroDivisionError(lhs, rhs);
} }
op_color_deprecation(op, lhs.to_string(), rhs.to_string(), pstate);
return SASS_MEMORY_NEW(Color, return SASS_MEMORY_NEW(Color,
pstate, pstate,
ops[op](lhs.r(), rval), ops[op](lhs.r(), rval),
......
...@@ -1598,6 +1598,19 @@ namespace Sass { ...@@ -1598,6 +1598,19 @@ namespace Sass {
1, // alpha channel 1, // alpha channel
parsed); parsed);
} }
else if (parsed.length() == 5) {
std::string r(2, parsed[1]);
std::string g(2, parsed[2]);
std::string b(2, parsed[3]);
std::string a(2, parsed[4]);
color = SASS_MEMORY_NEW(Color,
pstate,
static_cast<double>(strtol(r.c_str(), NULL, 16)),
static_cast<double>(strtol(g.c_str(), NULL, 16)),
static_cast<double>(strtol(b.c_str(), NULL, 16)),
static_cast<double>(strtol(a.c_str(), NULL, 16)) / 255,
parsed);
}
else if (parsed.length() == 7) { else if (parsed.length() == 7) {
std::string r(parsed.substr(1,2)); std::string r(parsed.substr(1,2));
std::string g(parsed.substr(3,2)); std::string g(parsed.substr(3,2));
...@@ -1694,17 +1707,7 @@ namespace Sass { ...@@ -1694,17 +1707,7 @@ namespace Sass {
{ return lexed_hex_color(lexed); } { return lexed_hex_color(lexed); }
if (lex< hexa >()) if (lex< hexa >())
{ { return lexed_hex_color(lexed); }
std::string s = lexed.to_string();
deprecated(
"The value \""+s+"\" is currently parsed as a string, but it will be parsed as a color in",
"future versions of Sass. Use \"unquote('"+s+"')\" to continue parsing it as a string.",
true, pstate
);
return SASS_MEMORY_NEW(String_Quoted, pstate, lexed);
}
if (lex< sequence < exactly <'#'>, identifier > >()) if (lex< sequence < exactly <'#'>, identifier > >())
{ return SASS_MEMORY_NEW(String_Quoted, pstate, lexed); } { return SASS_MEMORY_NEW(String_Quoted, pstate, lexed); }
...@@ -1723,10 +1726,6 @@ namespace Sass { ...@@ -1723,10 +1726,6 @@ namespace Sass {
if (lex< variable >()) if (lex< variable >())
{ return SASS_MEMORY_NEW(Variable, pstate, Util::normalize_underscores(lexed)); } { return SASS_MEMORY_NEW(Variable, pstate, Util::normalize_underscores(lexed)); }
// Special case handling for `%` proceeding an interpolant.
if (lex< sequence< exactly<'%'>, optional< percentage > > >())
{ return SASS_MEMORY_NEW(String_Constant, pstate, lexed); }
css_error("Invalid CSS", " after ", ": expected expression (e.g. 1px, bold), was "); css_error("Invalid CSS", " after ", ": expected expression (e.g. 1px, bold), was ");
// unreachable statement // unreachable statement
...@@ -2167,6 +2166,7 @@ namespace Sass { ...@@ -2167,6 +2166,7 @@ namespace Sass {
while (pp && peek< exactly< hash_lbrace > >(pp)) { while (pp && peek< exactly< hash_lbrace > >(pp)) {
pp = sequence< interpolant, real_uri_value >(pp); pp = sequence< interpolant, real_uri_value >(pp);
} }
if (!pp) return 0;
position = pp; position = pp;
return parse_interpolated_chunk(Token(p, position)); return parse_interpolated_chunk(Token(p, position));
} }
......
...@@ -524,7 +524,6 @@ extern "C" { ...@@ -524,7 +524,6 @@ extern "C" {
options->c_headers = 0; options->c_headers = 0;
options->plugin_paths = 0; options->plugin_paths = 0;
options->include_paths = 0; options->include_paths = 0;
options->extensions = 0;
} }
// helper function, not exported, only accessible locally // helper function, not exported, only accessible locally
...@@ -559,18 +558,6 @@ extern "C" { ...@@ -559,18 +558,6 @@ extern "C" {
cur = next; cur = next;
} }
} }
// Deallocate extension
if (options->extensions) {
struct string_list* cur;
struct string_list* next;
cur = options->extensions;
while (cur) {
next = cur->next;
free(cur->string);
free(cur);
cur = next;
}
}
// Free options strings // Free options strings
free(options->input_path); free(options->input_path);
free(options->output_path); free(options->output_path);
...@@ -590,7 +577,6 @@ extern "C" { ...@@ -590,7 +577,6 @@ extern "C" {
options->c_headers = 0; options->c_headers = 0;
options->plugin_paths = 0; options->plugin_paths = 0;
options->include_paths = 0; options->include_paths = 0;
options->extensions = 0;
} }
// helper function, not exported, only accessible locally // helper function, not exported, only accessible locally
...@@ -727,22 +713,6 @@ extern "C" { ...@@ -727,22 +713,6 @@ extern "C" {
IMPLEMENT_SASS_CONTEXT_TAKER(char*, source_map_string); IMPLEMENT_SASS_CONTEXT_TAKER(char*, source_map_string);
IMPLEMENT_SASS_CONTEXT_TAKER(char**, included_files); IMPLEMENT_SASS_CONTEXT_TAKER(char**, included_files);
// Push function for import extenions
void ADDCALL sass_option_push_import_extension(struct Sass_Options* options, const char* ext)
{
struct string_list* extension = (struct string_list*) calloc(1, sizeof(struct string_list));
if (extension == 0) return;
extension->string = ext ? sass_copy_c_string(ext) : 0;
struct string_list* last = options->extensions;
if (!options->extensions) {
options->extensions = extension;
} else {
while (last->next)
last = last->next;
last->next = extension;
}
}
// Push function for include paths (no manipulation support for now) // Push function for include paths (no manipulation support for now)
void ADDCALL sass_option_push_include_path(struct Sass_Options* options, const char* path) void ADDCALL sass_option_push_include_path(struct Sass_Options* options, const char* path)
{ {
......
...@@ -40,12 +40,9 @@ struct Sass_Options : Sass_Output_Options { ...@@ -40,12 +40,9 @@ struct Sass_Options : Sass_Output_Options {
// Colon-separated list of paths // Colon-separated list of paths
// Semicolon-separated on Windows // Semicolon-separated on Windows
// Maybe use array interface instead? // Maybe use array interface instead?
char* extension;
char* include_path; char* include_path;
char* plugin_path; char* plugin_path;
// Extensions (linked string list)
struct string_list* extensions;
// Include paths (linked string list) // Include paths (linked string list)
struct string_list* include_paths; struct string_list* include_paths;
// Plugin paths (linked string list) // Plugin paths (linked string list)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment