MCPcopy Create free account
hub / github.com/cuberite/cuberite / readToken

Method readToken

lib/jsoncpp/src/lib_json/json_reader.cpp:273–345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

271
272
273bool
274Reader::readToken( Token &token )
275{
276 skipSpaces();
277 token.start_ = current_;
278 Char c = getNextChar();
279 bool ok = true;
280 switch ( c )
281 {
282 case '{':
283 token.type_ = tokenObjectBegin;
284 break;
285 case '}':
286 token.type_ = tokenObjectEnd;
287 break;
288 case '[':
289 token.type_ = tokenArrayBegin;
290 break;
291 case ']':
292 token.type_ = tokenArrayEnd;
293 break;
294 case '"':
295 token.type_ = tokenString;
296 ok = readString();
297 break;
298 case '/':
299 token.type_ = tokenComment;
300 ok = readComment();
301 break;
302 case '0':
303 case '1':
304 case '2':
305 case '3':
306 case '4':
307 case '5':
308 case '6':
309 case '7':
310 case '8':
311 case '9':
312 case '-':
313 token.type_ = tokenNumber;
314 readNumber();
315 break;
316 case 't':
317 token.type_ = tokenTrue;
318 ok = match( "rue", 3 );
319 break;
320 case 'f':
321 token.type_ = tokenFalse;
322 ok = match( "alse", 4 );
323 break;
324 case 'n':
325 token.type_ = tokenNull;
326 ok = match( "ull", 3 );
327 break;
328 case ',':
329 token.type_ = tokenArraySeparator;
330 break;

Callers

nothing calls this directly

Calls 1

matchFunction · 0.85

Tested by

no test coverage detected