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

Function findTokenStart

parser.go:82–93  ·  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

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

Callers 3

deleteFoundConfigFunction · 0.85

Calls

no outgoing calls

Tested by 2