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

Function tokenEnd

parser.go:54–65  ·  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

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

Calls

no outgoing calls