new parser rules

This commit is contained in:
adam j hartz 2016-05-20 19:22:33 -04:00
parent eff7378cb2
commit 891c6af771
2 changed files with 12 additions and 2 deletions

View file

@ -2174,7 +2174,7 @@ class BaseParser(object):
p1 = p[1]
p0 = xonsh_call('__xonsh_subproc_captured_stdout__', args=p[2],
lineno=p1.lineno, col=p1.lexpos)
p0._cliarg_action = 'splitlines'
p0._cliarg_action = 'append'
p[0] = p0
def p_subproc_atom_pyenv_lookup(self, p):
@ -2198,6 +2198,13 @@ class BaseParser(object):
p0._cliarg_action = 'extend'
p[0] = p0
def p_subproc_atom_subproc_inject(self, p):
"""subproc_atom : ATDOLLAR_LPAREN subproc RPAREN"""
p0 = xonsh_call('__xonsh_subproc_captured_inject__', p[2],
lineno=self.lineno, col=self.col)
p0._cliarg_action = 'extend'
p[0] = p0
def p_subproc_atom_redirect(self, p):
"""subproc_atom : GT
| LT
@ -2265,6 +2272,7 @@ class BaseParser(object):
| PLUS
| COLON
| AT
| ATDOLLAR
| EQUALS
| TIMES
| POW
@ -2277,6 +2285,8 @@ class BaseParser(object):
| FALSE
| NUMBER
| STRING
| QUESTION
| COMMA
"""
# Many tokens cannot be part of this list, such as $, ', ", ()
# Use a string atom instead.

View file

@ -56,7 +56,7 @@ DefaultNotGiven = DefaultNotGivenType()
BEG_TOK_SKIPS = frozenset(['WS', 'INDENT', 'NOT', 'LPAREN'])
END_TOK_TYPES = frozenset(['SEMI', 'AND', 'OR', 'RPAREN'])
LPARENS = frozenset(['LPAREN', 'AT_LPAREN', 'BANG_LPAREN', 'DOLLAR_LPAREN'])
LPARENS = frozenset(['LPAREN', 'AT_LPAREN', 'BANG_LPAREN', 'DOLLAR_LPAREN', 'ATDOLLAR_LPAREN'])
def _is_not_lparen_and_rparen(lparens, rtok):
"""Tests if an RPAREN token is matched with something other than a plain old