The problem is that the $AWK
is already highlighted by the shDerefSimple
syntax group, so your new region isn't applied. Split the syntax definition into two parts and add the containedin=
for the latter:
syn region AWKScriptEmbedded matchgroup=AWKCommand
\ start=+\<g\?awk\>+ skip=+\\$+ end=+[=\\]\@<!'+me=e-1
\ contains=@shIdList,@shExprList2 nextgroup=AWKScriptCode
syn region AWKScriptEmbedded matchgroup=AWKCommand
\ start=+\$AWK\>+ skip=+\\$+ end=+[=\\]\@<!'+me=e-1
\ contains=@shIdList,@shExprList2 containedin=shDerefSimple nextgroup=AWKScriptCode