Packages
Packages copied to clipboard
[ShellScript] Improve highlighting accuracy of test expressions
According to the bash docs...
- the
test ...command doesn't support Perl like pattern matching via=~operator. - supported features / allowed expressions differ between
[ ... ]and[[ ... ]]operators. - highlighting would probably need to be distinguished between string/pattern matching and arithmetic comparisons
- In case of presence of
-eqor equivalent operator the test expression needs to be treated as arithmetic expression like within(( ... )) - otherwise tests compare strings or do pattern matching
- or perform unary file tests
- In case of presence of
All different kinds of test statements share the same quite naive implementation at the moment, which causes some inaccuracies in some edge cases.