Support for such nested variables was recently added in git source repository. I've defined a grammar for variables and derived a parser and compiler for it. In short, although it behaves compatibly, the new code is very different than previously existing variable substitution code.