driver: Convert to anonymous function.

This lets us set WARN_CREATE_GLOBAL, and enables the next two commits.
This commit is contained in:
Daniel Shahaf 2017-01-25 19:42:26 +00:00
parent 9523d6d49c
commit c53b078c89

View File

@ -1,3 +1,4 @@
() { # that's here to make the line numbers in errors match the file line numbers.
# ------------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------------
# Copyright (c) 2010-2016 zsh-syntax-highlighting contributors # Copyright (c) 2010-2016 zsh-syntax-highlighting contributors
# All rights reserved. # All rights reserved.
@ -28,13 +29,15 @@
# ------------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------------
# First of all, ensure predictable parsing. # First of all, ensure predictable parsing.
zsh_highlight__aliases=`builtin alias -Lm '[^+]*'` local zsh_highlight__aliases="`builtin alias -Lm '[^+]*'`"
# In zsh <= 5.2, `alias -L` emits aliases that begin with a plus sign ('alias -- +foo=42') # In zsh <= 5.2, `alias -L` emits aliases that begin with a plus sign ('alias -- +foo=42')
# them without a '--' guard, so they don't round trip. # them without a '--' guard, so they don't round trip.
# #
# Hence, we exclude them from unaliasing: # Hence, we exclude them from unaliasing:
builtin unalias -m '[^+]*' builtin unalias -m '[^+]*'
setopt localoptions warncreateglobal
# Set $0 to the expected value, regardless of functionargzero. # Set $0 to the expected value, regardless of functionargzero.
0=${(%):-%N} 0=${(%):-%N}
if true; then if true; then
@ -405,3 +408,6 @@ builtin unset zsh_highlight__aliases
# Set $?. # Set $?.
true true
# End anonymous function
}