You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Shell arithmetic syntax highlight breaks on multiple cases #148
@leagris is that first example you give using if working on all shells? (eg. bash,zsh,dash,sh)
It needs to be shell agnostic...
Besides re-coding just to avoid highlighting bugs in some editor is not the way to go 😉
@TriMoon
Stand-alone arithmetic expressions like in 1 are undefined in POSIX but supported everywhere.
Base specification with <base>#<number> in arithmetic expressions is undefined in POSIX as well, so I opted to use POSIX undefined stand-alone expressions as well :)
Activity
rsese commentedon Jul 2, 2019
Thanks again @leagris 👍 I can reproduce with on macOS 10.12.6 but not sure if this belongs in https://github.com/tree-sitter/tree-sitter-bash.
For example, I see that the issue with
base#has already been reported: tree-sitter/tree-sitter-bash#41.I think that leaves 2 issues from your report, I don't think these have been reported?
and:
I'll see which repo the other maintainers think the issue belongs.
TriMoon commentedon Aug 17, 2019
I was about to file a bug report for exactly this issue...
Please fix asap 😉
Atom's highlighting/parsing bugs after the hash sign of
2#0001A simple fix IMHO is to check for digits right infront of the hash sign....
leagris commentedon Aug 17, 2019
@TriMoon
or:
or:
or: Oh! Well, it does not show the bug then!
TriMoon commentedon Aug 17, 2019
@leagris is that first example you give using
ifworking on all shells? (eg.bash,zsh,dash,sh)It needs to be shell agnostic...
Besides re-coding just to avoid highlighting bugs in some editor is not the way to go 😉
leagris commentedon Aug 17, 2019
@TriMoon
Stand-alone arithmetic expressions like in 1 are undefined in POSIX but supported everywhere.
Base specification with
<base>#<number>in arithmetic expressions is undefined in POSIX as well, so I opted to use POSIX undefined stand-alone expressions as well :)leagris commentedon Jan 22, 2020
The base value can be a variable name, so checking for
[:digit:]#would break this way.The correct fix is to turn-off comments parsing within an arithmetic expression, as there is no comment allowed within it.