Fix splitting of whitespace at EOL
This commit is contained in:
parent
d730471fd7
commit
ac61422059
@ -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| /
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user