Fix splitting of whitespace at EOL

This commit is contained in:
Florian Bruhin 2014-11-06 08:25:46 +01:00
parent d730471fd7
commit ac61422059
2 changed files with 4 additions and 2 deletions

View File

@ -39,6 +39,7 @@ one "two three/one|two three/one| "two three/
one 'two three/one|two three/one| 'two three/
one\/one\/one\/
one "two\/one|two\/one| "two\/
one /one/one| /
foo bar/foo|bar/foo| bar/
foo bar/foo|bar/ foo| bar/
foo bar /foo|bar/ foo| bar| /

View File

@ -56,8 +56,6 @@ class ShellLexer:
except StopIteration:
if self.state in self.escape and not self.keep:
self.token += self.state
if self.state in self.whitespace:
yield self.state
if self.token or self.quoted:
yield self.token
return
@ -146,4 +144,7 @@ def split(s, keep=False):
else:
out.append(spaces + t)
spaces = ""
if spaces:
out.append(spaces)
return out