mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
str().split() | grep exit now throws a SyntaxError
This commit is contained in:
parent
4d86b7bdec
commit
c1712eeaed
2 changed files with 16 additions and 1 deletions
|
@ -83,6 +83,20 @@ def test_bad_indent():
|
|||
'x = 1\n')
|
||||
assert_raises(SyntaxError, check_parse, code)
|
||||
|
||||
def test_bad_rhs_subproc():
|
||||
code = 'str().split() | grep exit\n'
|
||||
assert_raises(SyntaxError, check_parse, code)
|
||||
|
||||
def test_good_rhs_subproc():
|
||||
# nonsense but parsebale
|
||||
code = 'str().split() | ![grep exit]\n'
|
||||
check_parse(code)
|
||||
|
||||
def test_bad_rhs_subproc():
|
||||
# nonsense but unparsebale
|
||||
code = 'str().split() | grep exit\n'
|
||||
assert_raises(SyntaxError, check_parse, code)
|
||||
|
||||
def test_indent_with_empty_line():
|
||||
code = ('if True:\n'
|
||||
'\n'
|
||||
|
|
|
@ -204,7 +204,8 @@ class Execer(object):
|
|||
else:
|
||||
# or for some other syntax error
|
||||
raise original_error
|
||||
elif sbpline.lstrip().startswith('![!['):
|
||||
elif sbpline[last_error_col:].startswith('![![') or \
|
||||
sbpline.lstrip().startswith('![!['):
|
||||
# if we have already wrapped this in subproc tokens
|
||||
# and it still doesn't work, adding more won't help
|
||||
# anything
|
||||
|
|
Loading…
Add table
Reference in a new issue