MCPcopy Create free account
hub / github.com/blues/note / tokenError

Method tokenError

jsonxt/stream.go:467–484  ·  view source on GitHub ↗
(c byte)

Source from the content-addressed store, hash-verified

465}
466
467func (dec *Decoder) tokenError(c byte) (Token, error) {
468 var context string
469 switch dec.tokenState {
470 case tokenTopValue:
471 context = " looking for beginning of value"
472 case tokenArrayStart, tokenArrayValue, tokenObjectValue:
473 context = " looking for beginning of value"
474 case tokenArrayComma:
475 context = " after array element"
476 case tokenObjectKey:
477 context = " looking for beginning of object key string"
478 case tokenObjectColon:
479 context = " after object key"
480 case tokenObjectComma:
481 context = " after object key:value pair"
482 }
483 return nil, &SyntaxError{"invalid character " + quoteChar(c) + context, dec.offset()}
484}
485
486// More reports whether there is another element in the
487// current array or object being parsed.

Callers 1

TokenMethod · 0.95

Calls 2

offsetMethod · 0.95
quoteCharFunction · 0.85

Tested by

no test coverage detected