diff options
author | Rutger Broekhoff | 2024-01-02 18:56:31 +0100 |
---|---|---|
committer | Rutger Broekhoff | 2024-01-02 18:56:31 +0100 |
commit | 8db41da676ac8368ef7c2549d56239a5ff5eedde (patch) | |
tree | 09c427fd66de2ec1ebffc8342f5fdbb84b0701b5 /vendor/github.com/json-iterator/go/iter_skip_strict.go | |
parent | d4f75fb6db22e57577867445a022227e70958931 (diff) | |
download | gitolfs3-8db41da676ac8368ef7c2549d56239a5ff5eedde.tar.gz gitolfs3-8db41da676ac8368ef7c2549d56239a5ff5eedde.zip |
Delete vendor directory
Diffstat (limited to 'vendor/github.com/json-iterator/go/iter_skip_strict.go')
-rw-r--r-- | vendor/github.com/json-iterator/go/iter_skip_strict.go | 99 |
1 files changed, 0 insertions, 99 deletions
diff --git a/vendor/github.com/json-iterator/go/iter_skip_strict.go b/vendor/github.com/json-iterator/go/iter_skip_strict.go deleted file mode 100644 index 6cf66d0..0000000 --- a/vendor/github.com/json-iterator/go/iter_skip_strict.go +++ /dev/null | |||
@@ -1,99 +0,0 @@ | |||
1 | //+build !jsoniter_sloppy | ||
2 | |||
3 | package jsoniter | ||
4 | |||
5 | import ( | ||
6 | "fmt" | ||
7 | "io" | ||
8 | ) | ||
9 | |||
10 | func (iter *Iterator) skipNumber() { | ||
11 | if !iter.trySkipNumber() { | ||
12 | iter.unreadByte() | ||
13 | if iter.Error != nil && iter.Error != io.EOF { | ||
14 | return | ||
15 | } | ||
16 | iter.ReadFloat64() | ||
17 | if iter.Error != nil && iter.Error != io.EOF { | ||
18 | iter.Error = nil | ||
19 | iter.ReadBigFloat() | ||
20 | } | ||
21 | } | ||
22 | } | ||
23 | |||
24 | func (iter *Iterator) trySkipNumber() bool { | ||
25 | dotFound := false | ||
26 | for i := iter.head; i < iter.tail; i++ { | ||
27 | c := iter.buf[i] | ||
28 | switch c { | ||
29 | case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': | ||
30 | case '.': | ||
31 | if dotFound { | ||
32 | iter.ReportError("validateNumber", `more than one dot found in number`) | ||
33 | return true // already failed | ||
34 | } | ||
35 | if i+1 == iter.tail { | ||
36 | return false | ||
37 | } | ||
38 | c = iter.buf[i+1] | ||
39 | switch c { | ||
40 | case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': | ||
41 | default: | ||
42 | iter.ReportError("validateNumber", `missing digit after dot`) | ||
43 | return true // already failed | ||
44 | } | ||
45 | dotFound = true | ||
46 | default: | ||
47 | switch c { | ||
48 | case ',', ']', '}', ' ', '\t', '\n', '\r': | ||
49 | if iter.head == i { | ||
50 | return false // if - without following digits | ||
51 | } | ||
52 | iter.head = i | ||
53 | return true // must be valid | ||
54 | } | ||
55 | return false // may be invalid | ||
56 | } | ||
57 | } | ||
58 | return false | ||
59 | } | ||
60 | |||
61 | func (iter *Iterator) skipString() { | ||
62 | if !iter.trySkipString() { | ||
63 | iter.unreadByte() | ||
64 | iter.ReadString() | ||
65 | } | ||
66 | } | ||
67 | |||
68 | func (iter *Iterator) trySkipString() bool { | ||
69 | for i := iter.head; i < iter.tail; i++ { | ||
70 | c := iter.buf[i] | ||
71 | if c == '"' { | ||
72 | iter.head = i + 1 | ||
73 | return true // valid | ||
74 | } else if c == '\\' { | ||
75 | return false | ||
76 | } else if c < ' ' { | ||
77 | iter.ReportError("trySkipString", | ||
78 | fmt.Sprintf(`invalid control character found: %d`, c)) | ||
79 | return true // already failed | ||
80 | } | ||
81 | } | ||
82 | return false | ||
83 | } | ||
84 | |||
85 | func (iter *Iterator) skipObject() { | ||
86 | iter.unreadByte() | ||
87 | iter.ReadObjectCB(func(iter *Iterator, field string) bool { | ||
88 | iter.Skip() | ||
89 | return true | ||
90 | }) | ||
91 | } | ||
92 | |||
93 | func (iter *Iterator) skipArray() { | ||
94 | iter.unreadByte() | ||
95 | iter.ReadArrayCB(func(iter *Iterator) bool { | ||
96 | iter.Skip() | ||
97 | return true | ||
98 | }) | ||
99 | } | ||