mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 16:34:47 +01:00
reproduce behavior from normal lookups for ${} syntax
This commit is contained in:
parent
da0e76af2f
commit
1988b86719
1 changed files with 15 additions and 7 deletions
|
@ -2314,7 +2314,6 @@ class Parser(object):
|
|||
lineno=lineno,
|
||||
col_offset=col)
|
||||
|
||||
|
||||
def _envvar_by_name(self, var, lineno=None, col=None):
|
||||
"""Looks up a xonsh variable by name."""
|
||||
xenv = self._xenv(lineno=lineno, col=col)
|
||||
|
@ -2461,12 +2460,21 @@ class Parser(object):
|
|||
p0._cliarg_action = 'extend'
|
||||
elif p1 == '${':
|
||||
xenv = self._xenv(lineno=self.lineno, col=self.col)
|
||||
idx = ast.Index(value=p[2])
|
||||
p0 = ast.Subscript(value=xenv,
|
||||
slice=idx,
|
||||
ctx=ast.Load(),
|
||||
lineno=self.lineno,
|
||||
col_offset=self.col)
|
||||
func = ast.Attribute(value=xenv,
|
||||
attr='get',
|
||||
ctx = ast.Load(),
|
||||
lineno=self.lineno,
|
||||
col_offset=self.col)
|
||||
p0 = ast.Call(func=func,
|
||||
args=[p[2],
|
||||
ast.Str(s='',
|
||||
lineno=self.lineno,
|
||||
col_offset=self.col)],
|
||||
keywords=[],
|
||||
starargs=None,
|
||||
kwargs=None,
|
||||
lineno=self.lineno,
|
||||
col_offset=self.col)
|
||||
p0._cliarg_action = 'append'
|
||||
elif p1 == '$(':
|
||||
p0 = xonsh_call('__xonsh_subproc_captured__',
|
||||
|
|
Loading…
Add table
Reference in a new issue