mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2025-02-02 08:15:22 +00:00
Small fix to handle line breaks and tabs \r\n\t
This commit is contained in:
parent
561415cea9
commit
a9596cabe3
@ -69,6 +69,8 @@ class Lexer:
|
||||
text = self.text
|
||||
i = 0
|
||||
|
||||
whitespace = "\r\n\t "
|
||||
|
||||
#self.text.seek(self._text_pos)
|
||||
|
||||
while True:
|
||||
@ -98,7 +100,7 @@ class Lexer:
|
||||
self._state = self._states.pop()
|
||||
|
||||
elif self._state == State.TEXT:
|
||||
if ch == ' ':
|
||||
if ch in whitespace:
|
||||
if acc != '':
|
||||
break
|
||||
elif ch == '"' or ch == "'":
|
||||
@ -141,6 +143,7 @@ if __name__ == '__main__':
|
||||
cases.append(r' ')
|
||||
cases.append(r' ')
|
||||
cases.append(r'Hello World ')
|
||||
cases.append('\n\n\rHello\n World With Spaces\n\n')
|
||||
|
||||
for s in cases:
|
||||
lex = Lexer(s)
|
||||
|
Loading…
Reference in New Issue
Block a user