PowerShell
New version but works starting from PowerShell 3.0
function p{[scriptblock]::create($myinvocation.line).ast.findall({$args[0]-is[Management.Automation.Language.VariableExpressionAst]},0)[0]|% v*h|% u*|%{($_,!1)[!$_]}}
[Try It Online!][1]
Previous version
function p($a){$t=[management.automation.psparser]::tokenize($myinvocation.line,[ref]@())|? type -match '^[cv]'|? start|% content;($t,!1)[!$t]}
[Try It Online!][2] [1]:https://tio.run/##PY9RS8MwFIXf@ys6yGg7Zmh1Ig76sIehgpsPE19KGbc1bYNpEpJ0Kll@e00Z7uVc@M45l3ul@CZKd4SxcWwGXhsqeChtoWtFpamYqL/K9bpWBAyJUf9L@UnUMKUwo5wkGLTBDeWfwFhsEahWF2l5Q3WxAw4t6Qk3eDMY0V9Kr8DbwXP8AYpCxcj2Ryqitfc22pRumSa@f56Hp0XndVic5zZGx@UsS4oZOpbOjTJAICUjeTSdLaJAhhcQIE5ZHu2F6ShvPY8nkATo8Lbbvj@/7J/y1W32kE7GFSXB9e1GCOv8Nj@93uFsld0/@rB1yUT/YxUo68Y/ [2]:https://tio.run/##PY##PY9RS8MwEMff@ykyiKSBWaxOZBtFX0R9cD7Mt1IhhOsaTC8hvU1m189eUwd7@h@/BSsQwEIbvfYosRNLAWqyuiCtFL6IeXA96KxVCmG6D6SSksytrt89eE4U9zfB9M8w3x13590PhK4Ba8ex3qMm45D5nlNRtgrVDlpAytSeXKsml/3n1DGDqwdp7bHWoyDpnPuZIjp6ruFaot9IBUqB25XiVf@MGrMEBo1mtyX4DmB3LeHwzunf6fsAZhWQdom4dcyuM9o4MHdh73dcfEZ633jYh0IBXoeMa0Q4o37nJOy0Up6wWnZpq58t5CJVI6J7KUKgGZcTS2EhtHncHtn4gg4ve318eP55fNU7W6LG8ukjghmZ3ea50bpyhjlbFcFeWqvL5N7TjJ@RcnOq9BBqFYrct@A5hdS3h4NHpw@d1iDMC8D1NVTKuXpkdHRA7uO87ph4qvUh0pE2pEKdLpi2iHFHeuU03yWy3LGqRpGrry3UIjpMicSn56BTDgaW4iNo8bg7l9EEPH24/358/Vt81IsbvOHm0lckEwur9XO9UOUMWWMuyxf5PfLqewHOf4B