-
Notifications
You must be signed in to change notification settings - Fork 461
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
Refactor C++ context to expose call stack #1626
Conversation
This is pretty much ready, but could use some more testing. My poor memory leak tests seem to indicate that everything is freed as needed. There is room for more improvements though. |
Just to repeat how to access the import stack during custom functions now: union Sass_Value* call_sass_function(const union Sass_Value* s_args, Sass_Function_Entry cb, struct Sass_Compiler* compiler)
{
struct Sass_Import* import = sass_compiler_get_last_import(compiler);
const char* prev_abs_path = sass_import_get_abs_path(import);
const char* prev_imp_path = sass_import_get_imp_path(import);
...
} |
56f1e07
to
7fa5867
Compare
//CC @xzyfer @chriseppstein to fix eyeglass import once issue |
@mgreter I pulled out a bunch of the code that wasn't relevant larger refactor into #1662, #1663, #1664, #1665, #1666 This also appears to include the rounding refactor from #1621. Could you please rebase off master, and also remove those sass rounding commits? |
Will do, actually the main commit is mgreter@1a68364 which is still rather big. |
I'll work through it over the next couple days. Nothing has jumped out at me yet. This is probably one of the last things before 3.3.2. Could you also update the markdown docs as well? |
There is nothing to update in docs for this PR?? |
7fa5867
to
3e80de2
Compare
Disabled the wiki, since info is outdated and master is now in libsass repo ... maybe we could use git 2.6 subtree feature to get wiki visibility on github back ... still think submoduling gh-pages would also work. |
Sorry #1626 (comment) made me think there was |
Can you also rebase out the rounding commits? They don't belong here. |
3e80de2
to
fb18352
Compare
Rebased, but will probably result in merge conflicts with the other "rounding" PR ... |
That's ok. The rounding PR wont land in 3.3.2 because updating sass-spec to a new Ruby Sass breaks too many specs. (mostly on error messages / deprecation warnings) |
LGTM. I'm not sold on the names of the new classes, purely because without the comments their purpose is unclear. I would like to see #1626 (comment) added to documentation somewhere as part of this PR. Then feel free to 🚢 |
@xzyfer IMO rouding PR is quite important since we currently fail the spec tests when compiled for 32bit. |
fb18352
to
aa915e2
Compare
Refactor C++ context to expose call stack
This is a big refactor of the C++ context handling side. Basically we now directly use the C structs instead of converting them back and forth. Also made it more similar to the C-API by adding
Data_Context
andFile_Context
. We now also take care of initializing the options accordingly on the C++ side, so I was able to remove some stuff from the C-API.I tried to streamline the import handling by adding specific classes for all different but similar representations of import, resources, etc. I think this will make the internas much clearer once it is used consistently throughout the code (I already got rid of
Sass_Queues
struct).Fixes #1638