git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173421
91177308-0d34-0410-b5e6-
96231b3b80d8
lex_one_token - Lex a single 'sh' token. """
c = self.eat()
lex_one_token - Lex a single 'sh' token. """
c = self.eat()
return (c,)
if c == '|':
if self.maybe_eat('|'):
return (c,)
if c == '|':
if self.maybe_eat('|'):
def parse_pipeline(self):
negate = False
def parse_pipeline(self):
negate = False
- if self.look() == ('!',):
- self.lex()
- negate = True
commands = [self.parse_command()]
while self.look() == ('|',):
commands = [self.parse_command()]
while self.look() == ('|',):
Command(['c'], [])],
False))
Command(['c'], [])],
False))
- self.assertEqual(self.parse('! a'),
- Pipeline([Command(['a'], [])],
- True))
-
def test_list(self):
self.assertEqual(self.parse('a ; b'),
Seq(Pipeline([Command(['a'], [])], False),
def test_list(self):
self.assertEqual(self.parse('a ; b'),
Seq(Pipeline([Command(['a'], [])], False),