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

Function nextToken

parser.go:225–236  ·  view source on GitHub ↗

SYS-REQ-001 Find position of next character which is not whitespace reqproof:lemma nextToken_in_range func(data []byte) bool { r := nextToken(data) return r >= -1 && r < len(data) } reqproof:lemma nextToken_empty_neg func(data []byte) bool { return !(len(data) == 0) || nextToken(data)

(data []byte)

Source from the content-addressed store, hash-verified

223// return true
224// }
225func nextToken(data []byte) int {
226 for i, c := range data {
227 // reqproof:invariant 0 <= i
228 // reqproof:invariant i <= len(data)
229 if c == ' ' || c == '\n' || c == '\r' || c == '\t' {
230 continue
231 }
232 return i
233 }
234
235 return -1
236}
237
238// SYS-REQ-001
239// Find position of last character which is not whitespace

Callers 11

findKeyStartFunction · 0.85
searchKeysFunction · 0.85
EachKeyFunction · 0.85
DeleteFunction · 0.85
SetFunction · 0.85
internalGetFunction · 0.85
ArrayEachFunction · 0.85
ObjectEachFunction · 0.85

Calls

no outgoing calls