*highlight: Optimization: remove *-check-assign call

This commit is contained in:
Sebastian Gniazdowski 2016-10-17 06:48:44 +02:00
parent d2fbc7eb37
commit ab439966ee

View file

@ -442,7 +442,8 @@ typeset -gA HSMW_HIGHLIGHT_STYLES
function) style=function;; function) style=function;;
command) style=command;; command) style=command;;
hashed) style=hashed-command;; hashed) style=hashed-command;;
none) if -hsmw-highlight-check-assign; then none) # Assign?
if [[ $arg == [[:alpha:]_][[:alnum:]_]#(|\[*\])(|[+])=* ]] || [[ $arg == [0-9]##(|[+])=* ]]; then
style=assign style=assign
if [[ $arg[-1] == '(' ]]; then if [[ $arg[-1] == '(' ]]; then
in_array_assignment=true in_array_assignment=true
@ -621,14 +622,6 @@ typeset -gA HSMW_HIGHLIGHT_STYLES
done done
} }
# Check if $arg is variable assignment
-hsmw-highlight-check-assign()
{
setopt localoptions extended_glob
[[ $arg == [[:alpha:]_][[:alnum:]_]#(|\[*\])(|[+])=* ]] ||
[[ $arg == [0-9]##(|[+])=* ]]
}
-hsmw-highlight-path-separators() -hsmw-highlight-path-separators()
{ {
local pos style_pathsep local pos style_pathsep