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

Function tokenEnd

parser.go:55–66  ·  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

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

Calls

no outgoing calls