Benchmark harness support for STK-REQ-004.
(fs *fflib.FFLexer, state fflib.FFParseState)
| 1510 | |
| 1511 | // Benchmark harness support for STK-REQ-004. |
| 1512 | func (uj *DSTopicsList) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error { |
| 1513 | var err error = nil |
| 1514 | currentKey := ffj_t_DSTopicsListbase |
| 1515 | _ = currentKey |
| 1516 | tok := fflib.FFTok_init |
| 1517 | wantedTok := fflib.FFTok_init |
| 1518 | |
| 1519 | mainparse: |
| 1520 | for { |
| 1521 | tok = fs.Scan() |
| 1522 | // println(fmt.Sprintf("debug: tok: %v state: %v", tok, state)) |
| 1523 | if tok == fflib.FFTok_error { |
| 1524 | goto tokerror |
| 1525 | } |
| 1526 | |
| 1527 | switch state { |
| 1528 | |
| 1529 | case fflib.FFParse_map_start: |
| 1530 | if tok != fflib.FFTok_left_bracket { |
| 1531 | wantedTok = fflib.FFTok_left_bracket |
| 1532 | goto wrongtokenerror |
| 1533 | } |
| 1534 | state = fflib.FFParse_want_key |
| 1535 | continue |
| 1536 | |
| 1537 | case fflib.FFParse_after_value: |
| 1538 | if tok == fflib.FFTok_comma { |
| 1539 | state = fflib.FFParse_want_key |
| 1540 | } else if tok == fflib.FFTok_right_bracket { |
| 1541 | goto done |
| 1542 | } else { |
| 1543 | wantedTok = fflib.FFTok_comma |
| 1544 | goto wrongtokenerror |
| 1545 | } |
| 1546 | |
| 1547 | case fflib.FFParse_want_key: |
| 1548 | // json {} ended. goto exit. woo. |
| 1549 | if tok == fflib.FFTok_right_bracket { |
| 1550 | goto done |
| 1551 | } |
| 1552 | if tok != fflib.FFTok_string { |
| 1553 | wantedTok = fflib.FFTok_string |
| 1554 | goto wrongtokenerror |
| 1555 | } |
| 1556 | |
| 1557 | kn := fs.Output.Bytes() |
| 1558 | if len(kn) <= 0 { |
| 1559 | // "" case. hrm. |
| 1560 | currentKey = ffj_t_DSTopicsListno_such_key |
| 1561 | state = fflib.FFParse_want_colon |
| 1562 | goto mainparse |
| 1563 | } else { |
| 1564 | switch kn[0] { |
| 1565 | |
| 1566 | case 'M': |
| 1567 | |
| 1568 | if bytes.Equal(ffj_key_DSTopicsList_MoreTopicsUrl, kn) { |
| 1569 | currentKey = ffj_t_DSTopicsList_MoreTopicsUrl |
no test coverage detected