Packages icon indicating copy to clipboard operation
Packages copied to clipboard

[ShellScript] Improve highlighting accuracy of test expressions

Open deathaxe opened this issue 4 years ago • 0 comments

According to the bash docs...

  1. the test ... command doesn't support Perl like pattern matching via =~ operator.
  2. supported features / allowed expressions differ between [ ... ] and [[ ... ]] operators.
  3. highlighting would probably need to be distinguished between string/pattern matching and arithmetic comparisons
    • In case of presence of -eq or 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

All different kinds of test statements share the same quite naive implementation at the moment, which causes some inaccuracies in some edge cases.

deathaxe avatar Aug 29 '21 14:08 deathaxe