MCPcopy Create free account
hub / github.com/Illumina/paragraph / readToken

Method readToken

external/jsoncpp/jsoncpp.cpp:471–540  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

469}
470
471bool Reader::readToken(Token& token) {
472 skipSpaces();
473 token.start_ = current_;
474 Char c = getNextChar();
475 bool ok = true;
476 switch (c) {
477 case '{':
478 token.type_ = tokenObjectBegin;
479 break;
480 case '}':
481 token.type_ = tokenObjectEnd;
482 break;
483 case '[':
484 token.type_ = tokenArrayBegin;
485 break;
486 case ']':
487 token.type_ = tokenArrayEnd;
488 break;
489 case '"':
490 token.type_ = tokenString;
491 ok = readString();
492 break;
493 case '/':
494 token.type_ = tokenComment;
495 ok = readComment();
496 break;
497 case '0':
498 case '1':
499 case '2':
500 case '3':
501 case '4':
502 case '5':
503 case '6':
504 case '7':
505 case '8':
506 case '9':
507 case '-':
508 token.type_ = tokenNumber;
509 readNumber();
510 break;
511 case 't':
512 token.type_ = tokenTrue;
513 ok = match("rue", 3);
514 break;
515 case 'f':
516 token.type_ = tokenFalse;
517 ok = match("alse", 4);
518 break;
519 case 'n':
520 token.type_ = tokenNull;
521 ok = match("ull", 3);
522 break;
523 case ',':
524 token.type_ = tokenArraySeparator;
525 break;
526 case ':':
527 token.type_ = tokenMemberSeparator;
528 break;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected