Skip to content

less-parser: Handle edge case with single token mixins. #80

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

Merged
merged 2 commits into from
Jun 16, 2017

Conversation

ymichael
Copy link
Contributor

The parser didn't account for mixins that were used in the following manner:

.foo {.my-mixin}

Please check one:

  • New tests created for this change
  • Tests updated for this change

This PR:

  • Adds new API
  • Extends existing API, backwards-compatible
  • Introduces a breaking change
  • Fixes a bug

The parser didn't account for mixins that were used in the following manner:

```
.foo {.my-mixin}
```
Copy link
Owner

@shellscape shellscape left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

solid PR, thanks! a few tweaks needed to the test


expect(root.first.first.type).to.eql('rule');
expect(root.first.first.selector).to.eql('.mixin-name');
expect(root.first.params).to.be.an('undefined');
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please roll with .to.be.undefined here (http://chaijs.com/api/bdd/#method_undefined)

expect(root.first.first.selector).to.eql('.mixin-name');
expect(root.first.params).to.be.an('undefined');
expect(root.first.first.empty).to.eql(true);
expect(root.first.first.nodes).to.be.an('undefined');
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure! There are 2 other instances or this same usage in a separate test in this file so I'm changing all of these in a follow up commit.

@shellscape shellscape merged commit 5e94a55 into shellscape:master Jun 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants