main: Highlight {command,process} substitution delimiters

This commit is contained in:
Matthew Martin
2018-04-14 14:00:03 -05:00
parent 22839d08ef
commit e86f75a840
12 changed files with 95 additions and 15 deletions

View File

@@ -33,17 +33,24 @@ expected_region_highlight=(
"1 4 builtin" # echo
"6 18 default" # `echo \`42\``
"6 18 back-quoted-argument" # `echo \`42\``
"6 6 back-quoted-argument-delimiter" # `
"7 10 builtin" # echo
"12 17 default" # \`42\`
"12 17 back-quoted-argument" # \`42\`
"12 13 back-quoted-argument-delimiter" # \`
"14 15 unknown-token" # 42
"16 17 back-quoted-argument-delimiter" # \`
"18 18 back-quoted-argument-delimiter" # `
"20 39 default" # "is `echo equal` to"
"20 39 double-quoted-argument" # "is `echo equal` to"
"24 35 back-quoted-argument" # `echo equal`
"24 24 back-quoted-argument-delimiter" # `
"25 28 builtin" # echo
"30 34 default" # equal
"35 35 back-quoted-argument-delimiter" # `
"41 55 default" # `echo 6 times 9
"41 55 back-quoted-argument-unclosed" # `echo 6 times 9
"41 41 back-quoted-argument-delimiter" # `
"42 45 builtin" # echo
"47 47 default" # 6
"49 53 default" # times

View File

@@ -34,7 +34,9 @@ expected_region_highlight=(
'1 15 assign' # foo=$(echo bar)
'5 15 default' # $(echo bar)
'5 15 command-substitution' # $(echo bar)
'5 6 command-substitution-delimiter' # $(
'7 10 builtin' # echo
'12 14 default' # bar
'15 15 command-substitution-delimiter' # )
'17 17 builtin' # :
)

View File

@@ -34,6 +34,7 @@ expected_region_highlight=(
'1 1 builtin' # :
'3 15 default' # foo$(echo bar
'6 15 command-substitution' # $(echo bar
'6 7 command-substitution-delimiter' # $(
'8 11 builtin' # echo
'13 15 default' # bar
)

View File

@@ -36,27 +36,35 @@ expected_region_highlight=(
'1 4 builtin' # echo
'6 113 default' # Ph\'ng`echo lui "mg"\`echo lw\'nafh \\\`echo Cthu"lhu\\\` R\\'ly$(echo eh wag\\\`echo h\'nag\\\`'l' fht)agn`
'12 113 back-quoted-argument' # `echo lui "mg"\`echo lw\'nafh \\\`echo Cthu"lhu\\\` R\\'ly$(echo eh wag\\\`echo h\'nag\\\`'l' fht)agn`
'12 12 back-quoted-argument-delimiter' # `
'13 16 builtin' # echo
'18 20 default' # lui
'22 112 default' # "mg"\`echo lw\'nafh \\\`echo Cthu"lhu\\\` R\\'ly$(echo eh wag\\\`echo h\'nag\\\`'l' fht)agn
'22 25 double-quoted-argument' # "mg"
'26 112 back-quoted-argument-unclosed' # \`echo lw\'nafh \\\`echo Cthu"lhu\\\` R\\'ly$(echo eh wag\\\`echo h\'nag\\\`'l' fht)agn
'26 27 back-quoted-argument-delimiter' # \`
'28 31 builtin' # echo
'33 40 default' # lw\'nafh
'42 62 default' # \\\`echo Cthu"lhu\\\`
'42 62 back-quoted-argument' # \\\`echo Cthu"lhu\\\`
'42 45 back-quoted-argument-delimiter' # \\\`
'46 49 builtin' # echo
'51 58 default' # Cthu"lhu
'55 58 double-quoted-argument-unclosed' # "lhu
'59 62 back-quoted-argument-delimiter' # \\\`
'64 112 default' # R\\'ly$(echo eh wag\\\`echo h\'nag\\\`'l' fht)agn
'70 109 command-substitution' # $(echo eh wag\\\`echo h\'nag\\\`'l' fht)
'70 71 command-substitution-delimiter' # $(
'72 75 builtin' # echo
'77 78 default' # eh
'80 104 default' # wag\\\`echo h\'nag\\\`'l'
'83 101 back-quoted-argument' # \\\`echo h\'nag\\\`
'83 86 back-quoted-argument-delimiter' # \\\`
'87 90 builtin' # echo
'92 97 default' # h\'nag
'98 101 back-quoted-argument-delimiter' # \\\`
'102 104 single-quoted-argument' # 'l'
'106 108 default' # fht
'109 109 command-substitution-delimiter' # )
'113 113 unknown-token' # `
)

View File

@@ -35,5 +35,7 @@ expected_region_highlight=(
'3 8 default' # "$(:)"
'3 8 double-quoted-argument' # "$(:)"
'4 7 command-substitution' # $(:)
'4 5 command-substitution-delimiter' # $(
'6 6 builtin' # :
'7 7 command-substitution-delimiter' # )
)

View File

@@ -34,6 +34,8 @@ expected_region_highlight=(
'1 1 builtin' # :
'3 9 default' # =(<foo)
'3 9 process-substitution' # =(<foo)
'3 4 process-substitution-delimiter' # =(
'5 5 redirection' # <foo
'6 8 default' # foo
'9 9 process-substitution-delimiter' # )
)

View File

@@ -34,8 +34,10 @@ expected_region_highlight=(
'1 1 builtin' # :
'3 19 double-hyphen-option' # --foo=<(echo bar)
'9 19 process-substitution' # <(echo bar)
'9 10 process-substitution-delimiter' # <(
'11 14 builtin' # echo
'16 18 default' # bar
'19 19 process-substitution-delimiter' # )
'21 26 default' # "<(:)"
'21 26 double-quoted-argument' # "<(:)"
)

View File

@@ -34,14 +34,17 @@ expected_region_highlight=(
'1 4 builtin' # echo
'6 9 default' # =(:)
'6 9 process-substitution' # =(:)
'6 7 process-substitution-delimiter' # =(
'8 8 builtin' # :
'9 9 process-substitution-delimiter' # )
'11 15 default' # a=(:)
'17 26 default' # =(echo foo
'17 26 process-substitution' # =(echo foo
'17 18 process-substitution-delimiter' # =(
'19 22 builtin' # echo
'24 26 default' # foo
)
if [[ ${(z):-'$('} == '$( ' ]]; then # ignore zsh 5.0.8 bug
expected_region_highlight[6]='17 27 default' # =(echo foo
expected_region_highlight[8]='17 27 default' # =(echo foo
fi

View File

@@ -34,6 +34,8 @@ expected_region_highlight=(
'1 1 builtin' # :
'3 9 default' # $(<foo)
'3 9 command-substitution' # $(<foo)
'3 4 command-substitution-delimiter' # $(
'5 5 redirection' # <
'6 8 default' # foo
'9 9 command-substitution-delimiter' # )
)

View File

@@ -33,7 +33,9 @@ expected_region_highlight=(
"1 2 command" # ls
"4 8 default" # >(wc)
"4 8 process-substitution" # >(wc)
"4 5 process-substitution-delimiter" # >(
"6 7 command" # wc
"8 8 process-substitution-delimiter" # )
"10 10 commandseparator" # |
"12 13 command" # nl
)