MCPcopy Create free account
hub / github.com/buger/jsonparser / tokenEnd

Function tokenEnd

parser.go:53–64  ·  view source on GitHub ↗

SYS-REQ-044 reqproof:lemma tokenEnd_in_range func(data []byte) bool { r := tokenEnd(data) return r >= 0 && r <= len(data) } reqproof:lemma tokenEnd_nonneg func(data []byte) bool { // tokenEnd never signals via a negative sentinel — the empty-input // path returns len(data)==0 (still

(data []byte)

Source from the content-addressed store, hash-verified

51// return true
52// }
53func tokenEnd(data []byte) int {
54 for i, c := range data {
55 // reqproof:invariant 0 <= i
56 // reqproof:invariant i <= len(data)
57 if c != 32 && c != 10 && c != 13 && c != 9 && c != 44 && c != 125 && c != 93 {
58 continue
59 }
60 return i
61 }
62
63 return len(data)
64}
65
66// isJSONWhitespace reports whether b is one of the four JSON whitespace bytes
67// (space 0x20, tab 0x09, LF 0x0A, CR 0x0D) per RFC 8259 §2. Used by Delete's

Callers 11

DeleteFunction · 0.85
getTypeFunction · 0.85
BenchmarkTokenEnd_NumberFunction · 0.85
TestTokenEndSentinelFunction · 0.85

Calls

no outgoing calls