2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-06-05 03:40:53 +00:00

Merge pull request #890 from m-holger/jpsp

Eliminate the use of shared pointers in JSONParser
This commit is contained in:
Jay Berkenbilt 2023-02-18 17:43:02 -05:00 committed by GitHub
commit e4e03e9ac1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
41 changed files with 675 additions and 593 deletions

View File

@ -54,6 +54,7 @@ class JSON
{
public:
static int constexpr LATEST = 2;
JSON() = default;
QPDF_DLL
std::string unparse() const;

File diff suppressed because it is too large Load Diff

View File

@ -58,7 +58,6 @@ QPDFArgParser bad option for help 0
QPDFArgParser bad topic for help 0
QPDFArgParser invalid choice handler to unknown 0
JSON parse junk after object 0
JSON parse decimal with no digits 0
JSON parse invalid keyword 0
JSON parse expected colon 0
JSON parse expected , or } 0
@ -76,12 +75,13 @@ JSON parse duplicate point 0
JSON parse duplicate e 0
JSON parse unexpected sign 0
JSON parse numeric bad character 0
JSON parse number minus no digits 0
JSON parse incomplete number 0
JSON parse keyword bad character 0
JSON parse backslash bad character 0
JSON parse unterminated string 0
JSON parse control char in string 0
JSON parse leading zero 0
JSON parse number no digits 0
JSON parse premature end of u 0
JSON parse ls premature end of input 0
JSON parse bad hex after u 0
JSONHandler unhandled value 0
JSONHandler unexpected key 0

View File

@ -121,6 +121,14 @@ my @bad = (
"high high surrogate", # 38
"dangling high surrogate", # 39
"duplicate dictionary key", # 40
"decimal point after minus",# 41
"e after minus", # 42
"missing digit after e", # 43
"missing digit after e+/-", # 44
"tab char in string", # 45
"cr char in string", # 46
"lf char in string", # 47
"bs char in string", # 48
);
my $i = 0;

View File

@ -1 +1 @@
exception: bad-01.json: JSON: offset 9: material follows end of object: junk
exception: bad-01.json: JSON: offset 8: material follows end of object: junk

View File

@ -1 +1 @@
exception: bad-02.json: JSON: offset 11: material follows end of object: junk
exception: bad-02.json: JSON: offset 10: material follows end of object: junk

View File

@ -1 +1 @@
exception: bad-03.json: JSON: offset 16: material follows end of object: junk
exception: bad-03.json: JSON: offset 15: material follows end of object: junk

View File

@ -1 +1 @@
exception: bad-04.json: JSON: offset 5: decimal point with no digits
exception: bad-04.json: JSON: offset 4: unexpected character .

View File

@ -1 +1 @@
exception: bad-09.json: JSON: offset 3: expect string as dictionary key
exception: bad-09.json: JSON: offset 2: expect string as dictionary key

View File

@ -1 +1 @@
exception: bad-18.json: JSON: null character at offset 5
exception: bad-18.json: JSON: control or null character at offset 5

View File

@ -1 +1 @@
exception: bad-27.json: JSON: offset 6: unterminated string
exception: bad-27.json: JSON: offset 5: control character in string (missing "?)

View File

@ -1 +1 @@
exception: bad-28.json: JSON: offset 16: unterminated string
exception: bad-28.json: JSON: premature end of input

View File

@ -1 +1 @@
exception: bad-30.json: JSON: offset 5: decimal point with no digits
exception: bad-30.json: JSON: offset 4: numeric literal: incomplete number

View File

@ -1 +1 @@
-
-

View File

@ -1 +1 @@
exception: bad-31.json: JSON: offset 2: number with no digits
exception: bad-31.json: JSON: offset 1: numeric literal: incomplete number

View File

@ -1 +1 @@
exception: bad-32.json: JSON: offset 5: number with leading zero
exception: bad-32.json: JSON: offset 1: number with leading zero

View File

@ -1 +1 @@
exception: bad-33.json: JSON: offset 6: number with leading zero
exception: bad-33.json: JSON: offset 2: number with leading zero

View File

@ -1 +1 @@
exception: bad-34.json: JSON: offset 3: \u must be followed by four characters
exception: bad-34.json: JSON: premature end of input

View File

@ -0,0 +1,2 @@
-.123

View File

@ -0,0 +1 @@
exception: bad-41.json: JSON: offset 1: numeric literal: no digit after minus sign

View File

@ -0,0 +1 @@
-e123

View File

@ -0,0 +1 @@
exception: bad-42.json: JSON: offset 1: numeric literal: no digit after minus sign

View File

@ -0,0 +1 @@
123e

View File

@ -0,0 +1 @@
exception: bad-43.json: JSON: offset 4: numeric literal: incomplete number

View File

@ -0,0 +1 @@
123e+

View File

@ -0,0 +1 @@
exception: bad-44.json: JSON: offset 5: numeric literal: incomplete number

View File

@ -0,0 +1 @@
"Tab in str ing"

View File

@ -0,0 +1 @@
exception: bad-45.json: JSON: offset 11: control character in string (missing "?)

View File

@ -0,0 +1 @@
"cr in str ing"

View File

@ -0,0 +1 @@
exception: bad-46.json: JSON: offset 10: control character in string (missing "?)

View File

@ -0,0 +1,2 @@
"lf in str
ing"

View File

@ -0,0 +1 @@
exception: bad-47.json: JSON: offset 10: control character in string (missing "?)

View File

@ -0,0 +1 @@
"bs in string"

View File

@ -0,0 +1 @@
exception: bad-48.json: JSON: control or null character at offset 10

View File

@ -1,13 +1,13 @@
dictionary start
dictionary item: a -> [6, 11): "bcd"
dictionary item: e -> [18, 0): []
dictionary item: e -> [18, 19): []
array start
array item: [19, 20): 1
array item: [41, 42): 2
array item: [44, 45): 3
array item: [46, 47): 4
array item: [48, 54): "five"
array item: [56, 0): {}
array item: [56, 57): {}
dictionary start
dictionary item: six -> [64, 65): 7
dictionary item: 8 -> [72, 73): 9

View File

@ -1,15 +1,15 @@
array start
array item: [1, 0): []
array item: [1, 2): []
array start
array item: [2, 0): []
array item: [2, 3): []
array start
array item: [3, 0): {}
array item: [3, 4): {}
dictionary start
container end: [3, 5): {}
container end: [2, 6): []
array item: [8, 0): {}
array item: [8, 9): {}
dictionary start
dictionary item: -> [13, 0): {}
dictionary item: -> [13, 14): {}
dictionary start
container end: [13, 15): {}
container end: [8, 16): {}

View File

@ -1,21 +1,21 @@
dictionary start
dictionary item: a -> [9, 0): []
dictionary item: a -> [9, 10): []
array start
array item: [10, 11): 1
array item: [13, 14): 2
array item: [16, 0): {}
array item: [16, 17): {}
dictionary start
dictionary item: x -> [22, 25): "y"
container end: [16, 26): {}
array item: [28, 29): 3
array item: [31, 0): {}
array item: [31, 32): {}
dictionary start
dictionary item: keep -> [40, 61): "not in final output"
container end: [31, 62): {
"keep": "not in final output"
}
container end: [9, 63): []
dictionary item: keep -> [75, 0): []
dictionary item: keep -> [75, 76): []
array start
array item: [76, 77): 1
array item: [79, 83): null
@ -23,7 +23,7 @@ array item: [85, 86): 2
array item: [88, 93): false
array item: [95, 101): "keep"
array item: [103, 104): 3
array item: [106, 0): []
array item: [106, 107): []
array start
array item: [107, 113): "this"
array item: [115, 121): "keep"

View File

@ -1,12 +1,12 @@
array start
array item: [4, 0): []
array item: [4, 5): []
array start
array item: [5, 11): "u:π"
array item: [13, 23): "u:π"
array item: [25, 39): "b:EFBBBFCF80"
array item: [41, 53): "b:feff03c0"
container end: [4, 54): []
array item: [58, 0): []
array item: [58, 59): []
array start
array item: [59, 67): "u:🥔"
array item: [69, 85): "u:🥔"

View File

@ -1,3 +1,3 @@
WARNING: qjson-objects-not-dict.json (offset 82): "qpdf[1]" must be a dictionary
WARNING: qjson-objects-not-dict.json (offset 81): "qpdf[1]" must be a dictionary
WARNING: qjson-objects-not-dict.json: "qpdf[1].trailer" was not seen
qpdf: qjson-objects-not-dict.json: errors found in JSON

View File

@ -1,3 +1,3 @@
WARNING: qjson-stream-not-dict.json (obj:1 0 R, offset 123): "stream" must be a dictionary
WARNING: qjson-stream-not-dict.json (obj:1 0 R, offset 122): "stream" must be a dictionary
WARNING: qjson-stream-not-dict.json: "qpdf[1].trailer" was not seen
qpdf: qjson-stream-not-dict.json: errors found in JSON

View File

@ -1,2 +1,2 @@
WARNING: qjson-trailer-not-dict.json (trailer, offset 1269): "trailer.value" must be a dictionary
WARNING: qjson-trailer-not-dict.json (trailer, offset 1268): "trailer.value" must be a dictionary
qpdf: qjson-trailer-not-dict.json: errors found in JSON