mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-13 01:15:32 +00:00
lit/ShUtil.py: Deprecate '!' in shell expression. It is not sh-compatible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173421 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bfb8223e2b
commit
52d4de971f
@ -129,7 +129,7 @@ class ShLexer:
|
|||||||
lex_one_token - Lex a single 'sh' token. """
|
lex_one_token - Lex a single 'sh' token. """
|
||||||
|
|
||||||
c = self.eat()
|
c = self.eat()
|
||||||
if c in ';!':
|
if c == ';':
|
||||||
return (c,)
|
return (c,)
|
||||||
if c == '|':
|
if c == '|':
|
||||||
if self.maybe_eat('|'):
|
if self.maybe_eat('|'):
|
||||||
@ -219,9 +219,6 @@ class ShParser:
|
|||||||
|
|
||||||
def parse_pipeline(self):
|
def parse_pipeline(self):
|
||||||
negate = False
|
negate = False
|
||||||
if self.look() == ('!',):
|
|
||||||
self.lex()
|
|
||||||
negate = True
|
|
||||||
|
|
||||||
commands = [self.parse_command()]
|
commands = [self.parse_command()]
|
||||||
while self.look() == ('|',):
|
while self.look() == ('|',):
|
||||||
@ -317,10 +314,6 @@ class TestShParse(unittest.TestCase):
|
|||||||
Command(['c'], [])],
|
Command(['c'], [])],
|
||||||
False))
|
False))
|
||||||
|
|
||||||
self.assertEqual(self.parse('! a'),
|
|
||||||
Pipeline([Command(['a'], [])],
|
|
||||||
True))
|
|
||||||
|
|
||||||
def test_list(self):
|
def test_list(self):
|
||||||
self.assertEqual(self.parse('a ; b'),
|
self.assertEqual(self.parse('a ; b'),
|
||||||
Seq(Pipeline([Command(['a'], [])], False),
|
Seq(Pipeline([Command(['a'], [])], False),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user