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

Function findTokenStart

parser.go:80–91  ·  view source on GitHub ↗

SYS-REQ-001 NOTE: findTokenStart's two-conditional-return body shape exposes the translator's __early_val scoping bug; we leave it without an in-range lemma. (Documented as a Phase S.2c.4 follow-up.)

(data []byte, token byte)

Source from the content-addressed store, hash-verified

78// the translator's __early_val scoping bug; we leave it without an
79// in-range lemma. (Documented as a Phase S.2c.4 follow-up.)
80func findTokenStart(data []byte, token byte) int {
81 for i := len(data) - 1; i >= 0; i-- {
82 switch data[i] {
83 case token:
84 return i
85 case '[', '{':
86 return 0
87 }
88 }
89
90 return 0
91}
92
93// SYS-REQ-001, SYS-REQ-020, SYS-REQ-024
94func findKeyStart(data []byte, key string) (int, error) {

Callers 3

DeleteFunction · 0.85

Calls

no outgoing calls

Tested by 2