-
Notifications
You must be signed in to change notification settings - Fork 464
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
Parent selector #959
Parent selector #959
Conversation
Conflicts: ast.hpp
…elector * commit 'dea27e5e3cc61a0d9f00ffa3f598a1080c6502d6': (32 commits) Add plugin.cpp example to contrib directory Fix small issue with relative path creation on windows Fix small formatting error in Readme.md Fix issue with mingw32 build Fix some comments in C-API Move rpm spec file into contrib folder Remove code left overs from debugging Fix regression introduced in "root parent selector error" change sass_atof to be thread safe Add local unaware atof function Improve sourcemap output for prepended texts Implement number prefix parsing (/[\+\-]+/) Add error for parent selectors in root blocks Fix interpolation in media queries Improve comment parsing Add another fix for media query boundaries Parse line comments in blocks Fix illegal extending when no blocks are found Fix illegal extending accross media blocks More improvements ... Conflicts: ast.hpp
You can't understand my excitement to see movement on this @ekskimn. I'll dig into it soon. This may be of interest to you @1xProgrammer. |
I know who that might be actually. I can coordinate with him. On Mon, Mar 16, 2015 at 11:50 PM, Michael Mifsud notifications@github.com
|
also, how concerned should I be that the coverage decreased? while i did Just to be clear, what I did was separate out the contextualize that used On Mon, Mar 16, 2015 at 11:50 PM, Michael Mifsud notifications@github.com
|
This is almost certainly because you've added more code that is covered by our current active specs. |
I don't have a whole bunch of time atm, it's conference season for me. I'll take a look over the weekend at the latest. |
#548 I got the interpolation working~! |
ah dammit...i didn't see that....running those tests now...cross your fingers~! |
@@ -204,10 +204,9 @@ namespace Sass { | |||
{ | |||
String* old_p = d->property(); | |||
String* new_p = static_cast<String*>(old_p->perform(eval->with(env, backtrace))); | |||
Expression* value = d->value()->perform(eval->with(env, backtrace)); | |||
|
|||
Selector* p = selector_stack.size() >= 1 ? 0 : selector_stack.back(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this unused?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, It isn't supposed to be. I was using it in the next line and forgot to put it back in. Committing in a moment...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ok. TYT! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed~! good catch btw.
Some of the specs for this feature are segfaulting. These tests wont run in CI because they're disabled. You can run them locally checking out sass-spec and running the following
|
Please add |
if (p->selector()) { | ||
p->selector()->perform(this); | ||
string str = this->get_buffer(); | ||
str += ";"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason not use?
append_string(";");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no particular reason. I can change that
looks like the seg faulting tests are mixin argument tests....let me see if i can whip that out.... |
Apologies for the nitpicks. IMHO conventions are hugely important, more-so in open source code bases where people have limited time to contribute and want to know "the right way" to do things. |
edits responding to comments for append_string typo for the broken line comma added contextualize_eval to the visual studio project file.
I'm off for now. I'll take a closer look at the |
no, i totally agree. I'm the same way with my dev team (ask them...they'll tell you i'm a dictator =) ) so I totally appreciate all the feedback |
@am11 added those files to the vs project file. |
append_string(";"); | ||
} | ||
else { | ||
append_string("&"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there should be an optional space, be sure to call append_optional_space()
too!
Contextualize_Eval::~Contextualize_Eval() { } | ||
|
||
Selector* Contextualize_Eval::fallback_impl(AST_Node* n) | ||
{ return Contextualize::fallback_impl(n); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I think I'm still confused by this class.
Contextualize_Eval::operator()(Selector_List* s) {
// Is there a difference between these two I'm missing?
return Contextualize::operator ()(s);
return s->preform(&instance_of_contextualize);
}
If not then you can remove these operators and fallback to the Contextualize
Selector* Contextualize_Eval::fallback_impl(AST_Node* n) {
return n->perform(&instance_of_contextualize);
}
Which will hit Contextualize::fallback_impl
if that operator type isn't defined.
Is it simply that you wish to opt-out of some Contextualize
operators? It's unclear from this diff alone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think i see what you're saying. I think I was thinking of it as that this class is a sort of decorator or just extension on the original contextualize class. I started down the path you are suggesting and went with inheritance in this case because I felt that it felt more natural. I can try it the other way again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So i tried that and a lot more tests broke. it's 2:48 am here =) so i will need to sleep...but I welcome more feedback. I'm looking at that one error statement that I removed. The test was the closed issue 930 that was breaking when it is uncommented in. That test, though, passes, when commented out (not exactly a litmus test but just saying).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, great work. I'll dig into it a bit and see what I come up with. If nothing else I'll better understand the intention here.
Updated below |
I got the test passing with this patch. It needs some cleaning up but it's 2am here. Then I'd feel pretty comfortable getting this shipped if you
/cc @hcatlin (this may interest you) |
1 similar comment
@ekskimn can you please squash this commits. AFAIK I see the outstanding todos:
|
One way to go about it is a two-fold (long) solution: cd into/libsass
git remote add libsass https://github.com/sass/libsass
git pull --rebase libsass master
git pull --rebase
git push -f # to rewrite the history It will squash away those merge commits. Then: git rebase -i HEAD~12 # here 12 is the number of commits you end-up with in this PR.
# editor will open, replace (only) `pick` with `f` for all commits but the first one.
# save and quit editor
git push -f # to rewrite the history again Following the exact steps will yield one clean commit. (however, you may want to keep them distributed) |
I tried a couple strategies for squashing this branch but the merge commits caused too many conflicts. For the sake of simplicity I've created a fully squashed patched rebased off the latest Libsass master.
|
Hey all. I am sorry i missed all these messages! I am in the middle of If u need me to try again i can do so within the hour
|
Yeah the merge commits really mad a mess of the branch. To be honest I'd just create a new branch and apply the patch from my previous comment. Make sure you sync you master with the latest Libsass master first.
|
Also, congrats on the new place. |
Sure np. Give me an hour
|
PR is up there from a new branch, #965 |
Superseded by #965 |
#548 PR over to you @xzyfer