PowerShell / EditorSyntax

PowerShell syntax highlighting for editors (VS Code, Atom, SublimeText, TextMate, etc.) and GitHub!
MIT License
133 stars 45 forks source link

scoping of operators is limited immediately following variable name #140

Open msftrncs opened 6 years ago

msftrncs commented 6 years ago

Issue Description

Operators scoped immediately after a variable, without whitespace, are limited to just arithmetic "[+%*/-]?=|[+/*%-] and 'other' &|(?<!\w)\.(?= )|`|,|\|, but all operators are valid (from what I can tell). This happens due to all the other operators requiring a negative look behind of a word character. The ${} variable reference correctly scopes the immediate following of the operators, because the } doesn't match the \w.

BTW, is that valid regex in the 'other' to have (?= ) or should it have been (?=\s) ??

Expected Behavior

All operators should be valid after a variable has scoped, from what I can determine.

I'm not sure this will be fixed easily due to the limited possibilities of TextMate.

Code Samples

$variable-split "3" #but this is valid operator function
${variable}-split "3" #but this is valid operator function