-
Notifications
You must be signed in to change notification settings - Fork 22
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
foo && bar should give 2 commands foo and bar, similar to foo ; bar. Note that this is a powershell 7 feature: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_pipeline_chain_operators?view=powershell-7.5&utm_source=chatgpt.com
|| kind of works for my use case, but only because it's detected as 2x | operators.
Note that I'm testing against ebe2ab2, I don't think any of the recent commits added this though.
Think this is the relevant section in grammar:
tree-sitter-powershell/grammar.js
Lines 165 to 200 in 497fe9a
| // Operators and punctuators | |
| assignement_operator: $ => choice( | |
| "=", "!=", "+=", "*=", "/=", "%=", "-=" | |
| ), | |
| file_redirection_operator: $ => choice( | |
| ">", ">>", "2>", "2>>", "3>", "3>>", "4>", "4>>", | |
| "5>", "5>>", "6>", "6>>", "*>", "*>>", "<" | |
| ), | |
| merging_redirection_operator: $ => choice( | |
| "*>&1", "2>&1", "3>&1", "4>&1", "5>&1", "6>&1", | |
| "*>&2", "1>&2", "3>&2", "4>&2", "5>&2", "6>&2" | |
| ), | |
| comparison_operator: $ => choice( | |
| reservedWord("-as"),reservedWord("-ccontains"),reservedWord("-ceq"), | |
| reservedWord("-cge"),reservedWord("-cgt"),reservedWord("-cle"), | |
| reservedWord("-clike"),reservedWord("-clt"),reservedWord("-cmatch"), | |
| reservedWord("-cne"),reservedWord("-cnotcontains"),reservedWord("-cnotlike"), | |
| reservedWord("-cnotmatch"),reservedWord("-contains"),reservedWord("-creplace"), | |
| reservedWord("-csplit"),reservedWord("-eq") ,reservedWord("-ge"), | |
| reservedWord("-gt"), reservedWord("-icontains"),reservedWord("-ieq"), | |
| reservedWord("-ige"),reservedWord("-igt"), reservedWord("-ile"), | |
| reservedWord("-ilike"),reservedWord("-ilt"),reservedWord("-imatch"), | |
| reservedWord("-in"),reservedWord("-ine"),reservedWord("-inotcontains"), | |
| reservedWord("-inotlike"),reservedWord("-inotmatch"),reservedWord("-ireplace"), | |
| reservedWord("-is"),reservedWord("-isnot"),reservedWord("-isplit"), | |
| reservedWord("-join"),reservedWord("-le"),reservedWord("-like"), | |
| reservedWord("-lt"),reservedWord("-match"),reservedWord("-ne"), | |
| reservedWord("-notcontains"),reservedWord("-notin"),reservedWord("-notlike"), | |
| reservedWord("-notmatch"),reservedWord("-replace"),reservedWord("-shl"), | |
| reservedWord("-shr"),reservedWord("-split") | |
| ), | |
| format_operator: $ => reservedWord("-f"), |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request