From 449bdf92c07f566729832a5c28dd39b743fc9d6f Mon Sep 17 00:00:00 2001 From: root Date: Sat, 25 Apr 2020 17:33:27 +0530 Subject: console error --- mitmproxy/command_lexer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mitmproxy/command_lexer.py b/mitmproxy/command_lexer.py index f042f3c9..93f87ac5 100644 --- a/mitmproxy/command_lexer.py +++ b/mitmproxy/command_lexer.py @@ -16,7 +16,7 @@ PartialQuotedString = pyparsing.Regex( | (?:\\.) # escape sequence )* - (?:\1|$) # end quote + (?:\1?|$) # end quote ''', re.VERBOSE ) -- cgit v1.2.3 From a0a5e8248183b46f554d13bf2a42fbbb1fb6fa09 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 1 May 2020 14:54:08 +0530 Subject: Changes on console error --- mitmproxy/command_lexer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mitmproxy/command_lexer.py b/mitmproxy/command_lexer.py index 93f87ac5..31458f4d 100644 --- a/mitmproxy/command_lexer.py +++ b/mitmproxy/command_lexer.py @@ -12,11 +12,11 @@ PartialQuotedString = pyparsing.Regex( r''' (["']) # start quote (?: - (?!\1)[^\\] # unescaped character that is not our quote nor the begin of an escape sequence. We can't use \1 in [] - | (?:\\.) # escape sequence + | + (?!\1). # unescaped character that is not our quote nor the begin of an escape sequence. We can't use \1 in [] )* - (?:\1?|$) # end quote + (?:\1|$) # end quote ''', re.VERBOSE ) -- cgit v1.2.3 From 4dd9abd6a9df35ef6b6488cccdd3b4a7f80c094a Mon Sep 17 00:00:00 2001 From: root Date: Fri, 1 May 2020 16:07:29 +0530 Subject: add test for console error --- test/mitmproxy/test_command_lexer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/mitmproxy/test_command_lexer.py b/test/mitmproxy/test_command_lexer.py index cdda1085..ec994087 100644 --- a/test/mitmproxy/test_command_lexer.py +++ b/test/mitmproxy/test_command_lexer.py @@ -16,6 +16,7 @@ from mitmproxy import command_lexer ("'foo'x", False), ('''"foo ''', True), ('''"foo 'bar' ''', True), + ('"foo\\', True), ] ) def test_partial_quoted_string(test_input, valid): @@ -34,6 +35,7 @@ def test_partial_quoted_string(test_input, valid): ("'foo'x", ["'foo'", 'x']), ('''"foo''', ['"foo']), ('''"foo 'bar' ''', ['''"foo 'bar' ''']), + ('"foo\\', ['"foo\\']), ] ) def test_expr(test_input, expected): -- cgit v1.2.3