Skip to content

&& and || pipeline chain operators not supported #27

@Tyriar

Description

@Tyriar

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:

// 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"),

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions