package config
import (
)
func ( *jsontext.Decoder) (option.Of[jsontext.Token], error) {
switch := .PeekKind(); {
case jsontext.KindBeginObject:
case jsontext.KindNull:
if , := .ReadToken(); != nil {
return option.Nil[jsontext.Token](),
}
return option.Nil[jsontext.Token](), nil
default:
return option.Nil[jsontext.Token](), fmt.Errorf("unexpected token %s", )
}
if , := .ReadToken(); != nil {
return option.Nil[jsontext.Token](),
}
if .PeekKind() == jsontext.KindEndObject {
if , := .ReadToken(); != nil {
return option.Nil[jsontext.Token](),
}
return option.Nil[jsontext.Token](), nil
}
, := .ReadToken()
if != nil {
return option.Nil[jsontext.Token](),
}
if := .Kind(); != jsontext.KindString {
return option.Nil[jsontext.Token](), fmt.Errorf("tag must be a string, got %s", )
}
return option.Value(), nil
}
func ( *jsontext.Decoder) error {
if := .PeekKind(); != jsontext.KindEndObject {
return errors.New("must contain exactly one tag")
}
, := .ReadToken()
return
}