bash-language-server icon indicating copy to clipboard operation
bash-language-server copied to clipboard

Modulus function shows parse error

Open icaptnbob opened this issue 4 years ago • 1 comments

The expression if (( $count % 2 == 0 )) incorrectly shows a "Failed to parse expression" error over the "% 2" This is a valid expression and works in the code.

When the spaces are removed, the parse error disappears if (( $count%2 == 0 ))

icaptnbob avatar May 12 '20 05:05 icaptnbob

I'm also seeing this issue for ((Year % 4 == 0)) where Year is a variable. Removing the spaces to ((Year%4 == 0)) fixes the parse error sad @icaptnbob mentioned, but when shellfmt runs it puts the spaces back in so the error reappears.

szTheory avatar Jun 09 '20 23:06 szTheory