mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 16:34:47 +01:00
add new captured subproc type to parser
This commit is contained in:
parent
e770e90fe7
commit
8e84d0ee8e
1 changed files with 12 additions and 3 deletions
|
@ -237,7 +237,8 @@ class BaseParser(object):
|
|||
'at', 'lshift', 'rshift', 'pipe', 'xor', 'ampersand',
|
||||
'for', 'colon', 'import', 'except', 'nonlocal', 'global',
|
||||
'yield', 'from', 'raise', 'with', 'dollar_lparen',
|
||||
'dollar_lbrace', 'dollar_lbracket', 'try']
|
||||
'dollar_lbrace', 'dollar_lbracket', 'try',
|
||||
'question_lparen']
|
||||
for rule in tok_rules:
|
||||
self._tok_rule(rule)
|
||||
|
||||
|
@ -2150,10 +2151,18 @@ class BaseParser(object):
|
|||
p0._cliarg_action = 'splitlines'
|
||||
p[0] = p0
|
||||
|
||||
def p_subproc_atom_captured(self, p):
|
||||
def p_subproc_atom_captured_stdout(self, p):
|
||||
"""subproc_atom : dollar_lparen_tok subproc RPAREN"""
|
||||
p1 = p[1]
|
||||
p0 = xonsh_call('__xonsh_subproc_captured__', args=p[2],
|
||||
p0 = xonsh_call('__xonsh_subproc_captured_stdout__', args=p[2],
|
||||
lineno=p1.lineno, col=p1.lexpos)
|
||||
p0._cliarg_action = 'splitlines'
|
||||
p[0] = p0
|
||||
|
||||
def p_subproc_atom_captured_object(self, p):
|
||||
"""subproc_atom : question_lparen_tok subproc RPAREN"""
|
||||
p1 = p[1]
|
||||
p0 = xonsh_call('__xonsh_subproc_captured_object__', args=p[2],
|
||||
lineno=p1.lineno, col=p1.lexpos)
|
||||
p0._cliarg_action = 'splitlines'
|
||||
p[0] = p0
|
||||
|
|
Loading…
Add table
Reference in a new issue