*highlight: Optimization: compress in_redirection-related code

parse.zsh -oo, after changes:

Running time: 1.8488320000
num  calls                time                       self            name
-----------------------------------------------------------------------------------
 1)  350        1841,21     5,26   99,99%   1364,52     3,90   74,10%  -hsmw-highlight-process
 2) 2800         336,95     0,12   18,30%    336,95     0,12   18,30%  -hsmw-highlight-string
 3) 2450          81,13     0,03    4,41%     81,13     0,03    4,41%  -hsmw-highlight-check-path
 4) 1400          40,74     0,03    2,21%     40,74     0,03    2,21%  -hsmw-highlight-main-type
 5)  350           9,80     0,03    0,53%      9,80     0,03    0,53%  -hsmw-highlight-stack-pop
 6)  350           8,08     0,02    0,44%      8,08     0,02    0,44%  -hsmw-highlight-path-separators
 7)    1           0,10     0,10    0,01%      0,10     0,10    0,01%  -hsmw-highlight-fill-option-variables
 8)    1           0,03     0,03    0,00%      0,03     0,03    0,00%  -hsmw-highlight-init
This commit is contained in:
Sebastian Gniazdowski 2016-10-25 16:47:02 +02:00
parent d34d812c71
commit 246f6e8627

View file

@ -286,16 +286,9 @@ __HSMW_HIGHLIGHT_TOKENS_TYPES=(
local proc_buf="$buf" local proc_buf="$buf"
for arg in ${interactive_comments-${(z)buf}} \ for arg in ${interactive_comments-${(z)buf}} \
${interactive_comments+${(zZ+c+)buf}}; do ${interactive_comments+${(zZ+c+)buf}}; do
# Initialize $next_word. # Initialize $next_word to its default value?
if (( in_redirection )); then (( in_redirection )) && (( --in_redirection ))
(( --in_redirection )) (( in_redirection == 0 )) && next_word=BIT_regular # else Stall $next_word.
fi
if (( in_redirection == 0 )); then
# Initialize $next_word to its default value.
next_word=BIT_regular
else
# Stall $next_word.
fi
# Initialize per-"simple command" [zshmisc(1)] variables: # Initialize per-"simple command" [zshmisc(1)] variables:
# #