# "Y" for curly
# "D" for do/done
# "$" for 'end' (matches 'foreach' always; also used with cshjunkiequotes in repeat/while)
+ # "?" for 'if'/'fi'; also checked by 'elif'/'else'
+ # ":" for 'then'
local braces_stack
if (( path_dirs_was_set )); then
('done')
_zsh_highlight_main__stack_pop 'D' style=reserved-word
;;
+ ('if')
+ braces_stack=':?'"$braces_stack"
+ ;;
+ ('then')
+ _zsh_highlight_main__stack_pop ':' style=reserved-word
+ ;;
+ ('elif')
+ if [[ ${braces_stack[1]} == '?' ]]; then
+ braces_stack=':'"$braces_stack"
+ else
+ style=unknown-token
+ fi
+ ;;
+ ('else')
+ if [[ ${braces_stack[1]} == '?' ]]; then
+ :
+ else
+ style=unknown-token
+ fi
+ ;;
+ ('fi')
+ _zsh_highlight_main__stack_pop '?' ""
+ ;;
('foreach')
braces_stack='$'"$braces_stack"
;;
already_added=1
;;
'`'*) style=back-quoted-argument;;
+ [$][*]) style=default;;
[*?]*|*[^\\][*?]*)
$highlight_glob && style=globbing || style=default;;
*) if false; then
continue
fi
;;
+ ($histchars[1]) # ! - may be a history expansion
+ if [[ $arg[i+1] != ('='|$'\x28'|$'\x7b'|[[:blank:]]) ]]; then
+ style=history-expansion
+ else
+ continue
+ fi
+ ;;
*) continue ;;
esac