-
Notifications
You must be signed in to change notification settings - Fork 371
Add support for % as a stand-alone expression
#2540
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
Conversation
This also deprecates user-defined functions named "type". See #2539
| /// Deprecation for functions named "type". | ||
| typeFunction( | ||
| 'type-function', | ||
| deprecatedIn: '1.86.0', | ||
| description: 'Functions named "type".', | ||
| ), | ||
|
|
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.
off-topic: for whatever reason when I generate the deprecations I end up getting a different formatting, like:
typeFunction('type-function', deprecatedIn: '1.86.0',
description: 'Functions named "type".'),do you happen to know what that would be? this is when running dart run grinder... I guess I may have some config file somewhere that tells dart to behave this way 🤔
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 saw something similar and I couldn't figure out exactly what it was. The Dart formatter is in the process of rolling out new changes so it's probably something related to that, but I don't know what exactly. I suspect making the generator add a trailing comma would force it to behave the same way for both the old and new formatter logic, though.
|
|
||
| if (operator == BinaryOperator.modulo && !_lookingAtExpression()) { | ||
| addSingleExpression(StringExpression.plain( | ||
| '%', scanner.spanFromPosition(scanner.position - 1))); |
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.
shouldn't this take the position before consuming whitespaces, so that it is actually the operator span ?
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.
Yeah, that's true. Want to send a fix?
This also deprecates user-defined functions named "type".
See #2539
[see sass/sass#4045]
[see sass/sass-spec#2051]