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 'two three/one|two three/one| 'two three/
|
||||||
one\/one\/one\/
|
one\/one\/one\/
|
||||||
one "two\/one|two\/one| "two\/
|
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/
|
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:
|
except StopIteration:
|
||||||
if self.state in self.escape and not self.keep:
|
if self.state in self.escape and not self.keep:
|
||||||
self.token += self.state
|
self.token += self.state
|
||||||
if self.state in self.whitespace:
|
|
||||||
yield self.state
|
|
||||||
if self.token or self.quoted:
|
if self.token or self.quoted:
|
||||||
yield self.token
|
yield self.token
|
||||||
return
|
return
|
||||||
@ -146,4 +144,7 @@ def split(s, keep=False):
|
|||||||
else:
|
else:
|
||||||
out.append(spaces + t)
|
out.append(spaces + t)
|
||||||
spaces = ""
|
spaces = ""
|
||||||
|
if spaces:
|
||||||
|
out.append(spaces)
|
||||||
|
|
||||||
return out
|
return out
|
||||||
|
Loading…
Reference in New Issue
Block a user