(b []byte)
| 386 | } |
| 387 | |
| 388 | func (d decoder) parseUnicode(b []byte) (rune, int, error) { |
| 389 | if len(b) < 4 { |
| 390 | return 0, len(b), syntaxError(b, "unicode code point must have at least 4 characters") |
| 391 | } |
| 392 | |
| 393 | u, r, err := d.parseUintHex(b[:4]) |
| 394 | if err != nil { |
| 395 | return 0, 4, syntaxError(b, "parsing unicode code point: %s", err) |
| 396 | } |
| 397 | |
| 398 | if len(r) != 0 { |
| 399 | return 0, 4, syntaxError(b, "invalid unicode code point") |
| 400 | } |
| 401 | |
| 402 | return rune(u), 4, nil |
| 403 | } |
| 404 | |
| 405 | func (d decoder) parseString(b []byte) ([]byte, []byte, Kind, error) { |
| 406 | if len(b) < 2 { |
no test coverage detected