@@ -45,6 +45,7 @@ namespace Sass {
4545 : mem(Memory_Manager<AST_Node>()),
4646 source_c_str (initializers.source_c_str()),
4747 sources (vector<const char *>()),
48+ c_functions (vector<Sass_C_Function_Descriptor>()),
4849 include_paths (initializers.include_paths()),
4950 queue (vector<pair<string, const char *> >()),
5051 style_sheets (map<string, Block*>()),
@@ -212,6 +213,9 @@ namespace Sass {
212213 Env tge;
213214 Backtrace backtrace (0 , " " , Position (), " " );
214215 register_built_in_functions (*this , &tge);
216+ for (size_t i = 0 , S = c_functions.size (); i < S; ++i) {
217+ register_c_function (*this , &tge, c_functions[i]);
218+ }
215219 Eval eval (*this , &tge, &backtrace);
216220 Contextualize contextualize (*this , &eval, &tge, &backtrace);
217221 Expand expand (*this , &eval, &contextualize, &tge, &backtrace);
@@ -282,7 +286,7 @@ namespace Sass {
282286 string cwd = getcwd (wd, wd_len);
283287 if (cwd[cwd.length () - 1 ] != ' /' ) cwd += ' /' ;
284288#ifdef _WIN32
285- replace (begin (cwd ), end (cwd ), ' \\ ' , ' /' ); // convert Windows backslashes to URL forward slashes
289+ replace (cwd. begin (), cwd. end (), ' \\ ' , ' /' ); // convert Windows backslashes to URL forward slashes
286290#endif
287291 return cwd;
288292 }
@@ -320,7 +324,7 @@ namespace Sass {
320324 {
321325 using namespace Functions ;
322326 // RGB Functions
323- register_function (ctx, rgb_sig, rgb, env);
327+ register_function (ctx, rgb_sig, rgb, env);
324328 register_overload_stub (ctx, " rgba" , env);
325329 register_function (ctx, rgba_4_sig, rgba_4, 4 , env);
326330 register_function (ctx, rgba_2_sig, rgba_2, 2 , env);
@@ -394,7 +398,7 @@ namespace Sass {
394398 }
395399 void register_c_function (Context& ctx, Env* env, Sass_C_Function_Descriptor descr)
396400 {
397- Definition* def = make_c_function (descr.signature , descr.function , ctx);
401+ Definition* def = make_c_function (descr.signature , descr.function , descr. cookie , ctx);
398402 def->environment (env);
399403 (*env)[def->name () + " [f]" ] = def;
400404 }
0 commit comments