*highlight: Compress code handling assignments

This commit is contained in:
Sebastian Gniazdowski 2016-10-25 17:24:05 +02:00
parent 0915653d7d
commit b8f92d4f89

View file

@ -462,13 +462,9 @@ __HSMW_HIGHLIGHT_TOKENS_TYPES=(
none) # Assign?
if [[ $arg == [[:alpha:]_][[:alnum:]_]#(|\[[^\]]#\])(|[+])=* ]] || [[ $arg == [0-9]##(|[+])=* ]]; then
style=assign
if [[ $arg[-1] == '(' ]]; then
in_array_assignment=1
else
# assignment to a scalar parameter.
# (For array assignments, the command doesn't start until the ")" token.)
(( next_word = next_word | BIT_start ))
fi
# Assignment to a scalar parameter or to array
# (For array assignments, the command doesn't start until the ")" token.)
[[ $arg[-1] == '(' ]] && in_array_assignment=1 || (( next_word = next_word | BIT_start ))
elif [[ $arg[0,1] = $histchars[0,1] ]] && (( $#arg[0,2] == 2 )); then
style=history-expansion
elif [[ $arg[0,1] == $histchars[2,2] ]]; then