| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
FYI this will clash with Posh-Git that implements an alias of ?? as below CommandType Name Version Source ----------- ---- ------- ------ Alias ?? -> Invoke-NullCoalescing 0.7.3 Posh-git |
Sorry, something went wrong.
|
We've already moved the use of ?? to internal-only in v1 and will happily get rid of it altogether for PS v7. |
Sorry, something went wrong.
There was a problem hiding this comment.
Really nice that this didn't require any changes to the parser and generally quite contained elsewhere -- feels like a vindication of good code for assignment processing.
Left a few comments.
Sorry, something went wrong.
| /// and all of the case sensitive variants of these operators, if they exists. | ||
| /// </summary> | ||
| BinaryPrecedenceComparison = 3, | ||
| BinaryPrecedenceComparison = 0x5, |
There was a problem hiding this comment.
Since enum's are treated like constants, this would be a breaking change for compiled projects right?
Sorry, something went wrong.
There was a problem hiding this comment.
Yes, this will be a breaking change. We are expecting the impact to very small though. I have updated the PR Context in description with more details.
Sorry, something went wrong.
|
This issue has changes that could potentially change syntax. Please consider adding this feature to EditorSyntax which is used for syntax highlighting in GitHub, Visual Studio Code, Atom, Sublime Text, and many more locations. Consistent syntax highlighting is very important for the language and a feature isn't "complete" until syntax highlighting is what is expected. If you can't contribute to EditorSyntax, at least open an issue to track the work - however, please note, that no one is actively working on the repo and so the work will likely not get done in a timely manner. We hope that you consider contributing to EditorSyntax. (note this is copy/pasted text for any change that looks like it could impact EditorSyntax - and will be a bot in the future) |
Sorry, something went wrong.
|
(thanks for opening the issue already!) |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM! Now waiting on the breaking change review from the committee.
Sorry, something went wrong.
|
It just occurred to me that none of the existing ICustomAstVisitor2.VisitBinaryExpression implementation is changed. |
Sorry, something went wrong.
It looks like that's just a question of the token flag: PowerShell/src/System.Management.Automation/engine/parser/ConstantValues.cs Lines 196 to 201 in beb8b44 |
Sorry, something went wrong.
|
Dongbo Wang (@daxian-dbw) I will review all the existing VisitBinaryExpression and VisitAssignmentStatement to see if anything needs to change. I will submit those changes as part of a different PR. |
Sorry, something went wrong.
|
@PowerShell/powershell-committee reviewed the changes to TokenFlags and agreed to accept this breaking change. We can revisit this decision if there is new feedback coming in during the use of 7.0.0-preview.5 and 7.0.0-preview.6 of pwsh. |
Sorry, something went wrong.
|
🎉v7.0.0-preview.5 has been released which incorporates this pull request.:tada: Handy links: |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
Implement the Null Coalescing ?? and Null Coalescing Assignment ??= operators.
PR Context
The operators are discussed in the issue #3240
This PR addresses part of RFC PowerShell/PowerShell-RFC#223
The PR is marked as a Breaking Change due to changes in the TokenFlags enum. The changes were made to include the new TokenFlag - BinaryPrecedenceCoalesce. While making this change, it was also decided to create more space in the BinaryPrecedence section of the enum for future binary operators. The BinaryPrecedenceMask was also changed from 0x07 to 0x0f. The order of precedence is not changed. We expected it can cause a breaking change for binary modules as C# treats enums as constants. Though, it is a breaking change we expect the impact to be pretty low as the usage of precedence token flags should be fairly low.
PR Checklist