Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass the compiler to custom functions instead of the options. #1227

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions eval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ namespace Sass {
To_C to_c;
union Sass_Value* c_args = sass_make_list(1, SASS_COMMA);
sass_list_set_value(c_args, 0, message->perform(&to_c));
Sass_Value* c_val = c_func(c_args, c_function, ctx.c_options);
Sass_Value* c_val = c_func(c_args, c_function, ctx.c_compiler);
sass_delete_value(c_args);
sass_delete_value(c_val);
return 0;
Expand Down Expand Up @@ -332,7 +332,7 @@ namespace Sass {
To_C to_c;
union Sass_Value* c_args = sass_make_list(1, SASS_COMMA);
sass_list_set_value(c_args, 0, message->perform(&to_c));
Sass_Value* c_val = c_func(c_args, c_function, ctx.c_options);
Sass_Value* c_val = c_func(c_args, c_function, ctx.c_compiler);
sass_delete_value(c_args);
sass_delete_value(c_val);
return 0;
Expand Down Expand Up @@ -361,7 +361,7 @@ namespace Sass {
To_C to_c;
union Sass_Value* c_args = sass_make_list(1, SASS_COMMA);
sass_list_set_value(c_args, 0, message->perform(&to_c));
Sass_Value* c_val = c_func(c_args, c_function, ctx.c_options);
Sass_Value* c_val = c_func(c_args, c_function, ctx.c_compiler);
sass_delete_value(c_args);
sass_delete_value(c_val);
return 0;
Expand Down Expand Up @@ -646,7 +646,7 @@ namespace Sass {
Expression* arg = static_cast<Expression*>(node);
sass_list_set_value(c_args, i, arg->perform(&to_c));
}
Sass_Value* c_val = c_func(c_args, c_function, ctx.c_options);
Sass_Value* c_val = c_func(c_args, c_function, ctx.c_compiler);
if (sass_value_get_tag(c_val) == SASS_ERROR) {
error("error in C function " + c->name() + ": " + sass_error_get_message(c_val), c->pstate(), backtrace);
} else if (sass_value_get_tag(c_val) == SASS_WARNING) {
Expand Down
2 changes: 1 addition & 1 deletion sass_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ typedef struct Sass_Function (*Sass_Function_Entry);
typedef struct Sass_Function* (*Sass_Function_List);
// Typedef defining function signature and return type
typedef union Sass_Value* (*Sass_Function_Fn)
(const union Sass_Value*, Sass_Function_Entry cb, struct Sass_Options* options);
(const union Sass_Value*, Sass_Function_Entry cb, struct Sass_Compiler* compiler);


// Creator for sass custom importer return argument list
Expand Down