Support @"" style strings for Obj-C syntax highlighting

This commit is contained in:
Jimmy Thrasher 2014-12-02 11:44:02 -05:00
parent e540dc7f9e
commit eddad89915

View File

@ -50,9 +50,15 @@ def -hidden _c-family-indent-on-closing-curly-brace %[
# Regions definition are the same between c++ and objective-c # Regions definition are the same between c++ and objective-c
%sh{ %sh{
for ft in cpp objc; do for ft in cpp objc; do
if [ "${ft}" = "objc" ]; then
maybe_at='@?'
else
maybe_at=''
fi
printf '%s' ' printf '%s' '
addhl -group / regions -default code FT \ addhl -group / regions -default code FT \
string %{(?<!QUOTE)"} %{(?<!\\)(\\\\)*"} "" \ string %{MAYBEAT(?<!QUOTE)"} %{(?<!\\)(\\\\)*"} "" \
comment /\* \*/ "" \ comment /\* \*/ "" \
comment // $ "" \ comment // $ "" \
disabled ^\h*?#\h*if\h+(0|FALSE)\b "#\h*(else|elif|endif)" "#\h*if(def)?" \ disabled ^\h*?#\h*if\h+(0|FALSE)\b "#\h*(else|elif|endif)" "#\h*if(def)?" \
@ -61,7 +67,7 @@ def -hidden _c-family-indent-on-closing-curly-brace %[
addhl -group /FT/string fill string addhl -group /FT/string fill string
addhl -group /FT/comment fill comment addhl -group /FT/comment fill comment
addhl -group /FT/disabled fill rgb:666666 addhl -group /FT/disabled fill rgb:666666
addhl -group /FT/macro fill meta' | sed -e "s/FT/${ft}/g; s/QUOTE/'/g" addhl -group /FT/macro fill meta' | sed -e "s/FT/${ft}/g; s/QUOTE/'/g; s/MAYBEAT/${maybe_at}/;"
done done
} }