MCPcopy Index your code
hub / github.com/json5/json5 / sign

Function sign

lib/parse.js:385–422  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

383 },
384
385 sign () {
386 switch (c) {
387 case '.':
388 buffer = read()
389 lexState = 'decimalPointLeading'
390 return
391
392 case '0':
393 buffer = read()
394 lexState = 'zero'
395 return
396
397 case '1':
398 case '2':
399 case '3':
400 case '4':
401 case '5':
402 case '6':
403 case '7':
404 case '8':
405 case '9':
406 buffer = read()
407 lexState = 'decimalInteger'
408 return
409
410 case 'I':
411 read()
412 literal('nfinity')
413 return newToken('numeric', sign * Infinity)
414
415 case 'N':
416 read()
417 literal('aN')
418 return newToken('numeric', NaN)
419 }
420
421 throw invalidChar(read())
422 },
423
424 zero () {
425 switch (c) {

Callers

nothing calls this directly

Calls 4

readFunction · 0.85
literalFunction · 0.85
newTokenFunction · 0.85
invalidCharFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…