mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-05-06 12:56:39 +02:00
40 lines
1.4 KiB
Diff
40 lines
1.4 KiB
Diff
diff --git a/commentjson/commentjson.py b/commentjson/commentjson.py
|
|
index 48eebb7..11a3de4 100755
|
|
--- a/commentjson/commentjson.py
|
|
+++ b/commentjson/commentjson.py
|
|
@@ -49,7 +49,11 @@ parser = Lark('''
|
|
| /(#|\\/\\/)[^\\n]*/
|
|
TRAILING_COMMA: ","
|
|
|
|
- %import common.ESCAPED_STRING
|
|
+ _STRING_INNER: /.*?/s
|
|
+ _STRING_ESC_INNER: _STRING_INNER /(?<!\\\\)(\\\\\\\\)*?/
|
|
+
|
|
+ ESCAPED_STRING : "\\"" _STRING_ESC_INNER "\\""
|
|
+
|
|
%import common.SIGNED_NUMBER
|
|
%import common.WS
|
|
%ignore WS
|
|
diff --git a/commentjson/tests/test_json/__init__.py b/commentjson/tests/test_json/__init__.py
|
|
index e97a5ce..4543677 100644
|
|
--- a/commentjson/tests/test_json/__init__.py
|
|
+++ b/commentjson/tests/test_json/__init__.py
|
|
@@ -7,3 +7,4 @@ class CommentJsonTest(unittest.TestCase):
|
|
json = commentjson
|
|
loads = staticmethod(commentjson.loads)
|
|
dumps = staticmethod(commentjson.dumps)
|
|
+ JSONDecodeError = ValueError
|
|
diff --git a/commentjson/tests/test_json/test_decode.py b/commentjson/tests/test_json/test_decode.py
|
|
index 6971c44..199a39d 100644
|
|
--- a/commentjson/tests/test_json/test_decode.py
|
|
+++ b/commentjson/tests/test_json/test_decode.py
|
|
@@ -17,8 +17,6 @@ class TestCommentJsonDecode(TestDecode, CommentJsonTest):
|
|
def __init__(self, *args, **kwargs):
|
|
super(TestCommentJsonDecode, self).__init__(*args, **kwargs)
|
|
|
|
- self.JSONDecodeError = ValueError
|
|
-
|
|
_json = self.json
|
|
|
|
class Decoder(object):
|