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

Function findTokenStart

parser.go:81–92  ·  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

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

Callers 3

deleteFoundConfigFunction · 0.85

Calls

no outgoing calls

Tested by 2