MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / parse_next

Method parse_next

include/chaiscript/utility/json.hpp:647–663  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

645 }
646
647 static JSON parse_next( const std::string &str, size_t &offset ) {
648 char value;
649 consume_ws( str, offset );
650 value = str.at(offset);
651 switch( value ) {
652 case '[' : return parse_array( str, offset );
653 case '{' : return parse_object( str, offset );
654 case '\"': return parse_string( str, offset );
655 case 't' :
656 case 'f' : return parse_bool( str, offset );
657 case 'n' : return parse_null( str, offset );
658 default : if( ( value <= '9' && value >= '0' ) || value == '-' ) {
659 return parse_number( str, offset );
660 }
661 }
662 throw std::runtime_error(std::string("JSON ERROR: Parse: Unexpected starting character '") + value + "'");
663 }
664
665};
666

Callers

nothing calls this directly

Calls 2

parse_stringFunction · 0.85
stringClass · 0.85

Tested by

no test coverage detected