func ValueDecodeJSON(token json.Token, dec *json.Decoder) (Value, error) {
	switch token := token.(type) {
	case nil:
		return nil, nil
	case json.Number:
		return ValueNumber(token), nil
	case string:
		return ValueString(token), nil
	case bool:
		return ValueBool(token), nil
	case json.Delim:
		if token != json.Delim('{') {
			return nil, fmt.Errorf("Unrecognized token %v", token)
		} else if relKey, err := dec.Token(); err != nil {
			return nil, err
		} else if relKey != "#" {
			return nil, fmt.Errorf("Unrecognized token %v", relKey)
		} else if relVal, err := dec.Token(); err != nil {
			return nil, err
		} else if relValStr, ok := relVal.(string); !ok {
			return nil, fmt.Errorf("Unrecognized token %v", relVal)
		} else if endTok, err := dec.Token(); err != nil {
			return nil, err
		} else if endTok != json.Delim('}') {
			return nil, fmt.Errorf("Unrecognized token %v", endTok)
		} else {
			return ValueRelation(relValStr), nil
		}
	default:
		return nil, fmt.Errorf("Unrecognized token %v", token)
	}
}
// ValueDecodeJSON decodes a single Value from JSON. For the given JSON decoder
// and last read token, this decodes a Value. The decoder needs to have ran
// UseNumber. Unrecognized values are errors.
ValueDecodeJSON decodes a single Value from JSON. For the given JSON decoder
and last read token, this decodes a Value. The decoder needs to have ran
UseNumber. Unrecognized values are errors.
// ValueDecodeJSON decodes a single Value from JSON . For the given JSON decoder // and last read token this decodes a Value . The decoder needs to have ran // UseNumber . Unrecognized values are errors .
func ValueDecodeJSON(token json.Token, dec *json.Decoder) (Value, error) {
	switch token := token.(type) {
	case nil:
		return nil, nil
	case json.Number:
		return ValueNumber(token), nil
	case string:
		return ValueString(token), nil
	case bool:
		return ValueBool(token), nil
	case json.Delim:
		if token != json.Delim('{') {
			return nil, fmt.Errorf("Unrecognized token %v", token)
		} else if relKey, err := dec.Token(); err != nil {
			return nil, err
		} else if relKey != "#" {
			return nil, fmt.Errorf("Unrecognized token %v", relKey)
		} else if relVal, err := dec.Token(); err != nil {
			return nil, err
		} else if relValStr, ok := relVal.(string); !ok {
			return nil, fmt.Errorf("Unrecognized token %v", relVal)
		} else if endTok, err := dec.Token(); err != nil {
			return nil, err
		} else if endTok != json.Delim('}') {
			return nil, fmt.Errorf("Unrecognized token %v", endTok)
		} else {
			return ValueRelation(relValStr), nil
		}
	default:
		return nil, fmt.Errorf("Unrecognized token %v", token)
	}
}
func ValueDecodeJSON ( token json . Token , dec * json . Decoder ) ( Value , error ) { switch token := token . ( type ) { case nil : return nil , nil case json . Number : return ValueNumber ( token ) , nil case string : return ValueString ( token ) , nil case bool : return ValueBool ( token ) , nil case json . Delim : if token != json . Delim ( '{' ) { return nil , fmt . Errorf ( " " , token ) } else if relKey , err := dec . Token ( ) ; err != nil { return nil , err } else if relKey != " " { return nil , fmt . Errorf ( " " , relKey ) } else if relVal , err := dec . Token ( ) ; err != nil { return nil , err } else if relValStr , ok := relVal . ( string ) ; ! ok { return nil , fmt . Errorf ( " " , relVal ) } else if endTok , err := dec . Token ( ) ; err != nil { return nil , err } else if endTok != json . Delim ( '}' ) { return nil , fmt . Errorf ( " " , endTok ) } else { return ValueRelation ( relValStr ) , nil } default : return nil , fmt . Errorf ( " " , token ) } }
ValueDecodeJSON decodes a single Value from JSON.
ValueDecodeJSON decodes a single Value from JSON .