diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2010-05-12 21:47:58 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2010-05-12 21:47:58 +0000 |
| commit | 12a78f502a613dceedd8a9c7a361f5efabcbe28b (patch) | |
| tree | 4f92a90ca5e1c5092ee1d19c941d9cf809cf1daa /llvm/utils | |
| parent | 7d73564b8211f52541e46b257d8fc8a60207c0d4 (diff) | |
| download | bcm5719-llvm-12a78f502a613dceedd8a9c7a361f5efabcbe28b.tar.gz bcm5719-llvm-12a78f502a613dceedd8a9c7a361f5efabcbe28b.zip | |
lit: Fix a sh lexing bug which caused annotate-token.m to fail when run with the
internal shell parser; we weren't lexing the quotes in a command like::
clang -DFOO='hello'
correctly.
llvm-svn: 103652
Diffstat (limited to 'llvm/utils')
| -rw-r--r-- | llvm/utils/lit/lit/ShUtil.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/utils/lit/lit/ShUtil.py b/llvm/utils/lit/lit/ShUtil.py index c8f933245d3..dda622a48a8 100644 --- a/llvm/utils/lit/lit/ShUtil.py +++ b/llvm/utils/lit/lit/ShUtil.py @@ -67,6 +67,9 @@ class ShLexer: elif c == '"': self.eat() str += self.lex_arg_quoted('"') + elif c == "'": + self.eat() + str += self.lex_arg_quoted("'") elif not self.win32Escapes and c == '\\': # Outside of a string, '\\' escapes everything. self.eat() @@ -287,6 +290,10 @@ class TestShParse(unittest.TestCase): Pipeline([Command(['echo', 'hello'], [])], False)) self.assertEqual(self.parse('echo ""'), Pipeline([Command(['echo', ''], [])], False)) + self.assertEqual(self.parse("""echo -DFOO='a'"""), + Pipeline([Command(['echo', '-DFOO=a'], [])], False)) + self.assertEqual(self.parse('echo -DFOO="a"'), + Pipeline([Command(['echo', '-DFOO=a'], [])], False)) def test_redirection(self): self.assertEqual(self.parse('echo hello > c'), |

