*highlight: Define also "buf" and "len" at one "local", etc. keyword

parse.zsh -oo, after changes:

Running time: 1.7114690000
num  calls                time                       self            name
-----------------------------------------------------------------------------------
 1)  350        1704,09     4,87  100,00%   1229,84     3,51   72,17%  -hsmw-highlight-process
 2) 2800         337,05     0,12   19,78%    337,05     0,12   19,78%  -hsmw-highlight-string
 3) 2450          81,20     0,03    4,76%     81,20     0,03    4,76%  -hsmw-highlight-check-path
 4) 1400          38,61     0,03    2,27%     38,61     0,03    2,27%  -hsmw-highlight-main-type
 5)  350           9,85     0,03    0,58%      9,85     0,03    0,58%  -hsmw-highlight-stack-pop
 6)  350           7,54     0,02    0,44%      7,54     0,02    0,44%  -hsmw-highlight-path-separators
 7)    1           0,07     0,07    0,00%      0,07     0,07    0,00%  -hsmw-highlight-fill-option-variables
 8)    1           0,01     0,01    0,00%      0,01     0,01    0,00%  -hsmw-highlight-init
This commit is contained in:
Sebastian Gniazdowski 2016-10-25 18:11:07 +02:00
parent 18cd426cb2
commit 13b3934f76

View file

@ -232,14 +232,11 @@ __HSMW_HIGHLIGHT_TOKENS_TYPES=(
# Variable declarations and initializations # Variable declarations and initializations
# in_array_assignment true between 'a=(' and the matching ')' # in_array_assignment true between 'a=(' and the matching ')'
# braces_stack: "R" for round, "Q" for square, "Y" for curly # braces_stack: "R" for round, "Q" for square, "Y" for curly
local start_pos=0 end_pos highlight_glob=1 arg style in_array_assignment=0 MATCH expanded_path braces_stack local start_pos=0 end_pos highlight_glob=1 arg style in_array_assignment=0 MATCH expanded_path braces_stack buf="$1"
# arg_type can be 0, 1, 2 or 3, i.e. precommand, control flow, command separator # arg_type can be 0, 1, 2 or 3, i.e. precommand, control flow, command separator
integer arg_type=0 MBEGIN MEND in_redirection integer arg_type=0 MBEGIN MEND in_redirection len="${#buf}"
local -a options_to_set match mbegin mend local -a options_to_set match mbegin mend
local buf="$1"
integer len="${#buf}"
(( path_dirs_was_set )) && options_to_set+=( PATH_DIRS ) (( path_dirs_was_set )) && options_to_set+=( PATH_DIRS )
# State machine # State machine