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

Function value

lib/parse.js:238–310  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

236 },
237
238 value () {
239 switch (c) {
240 case '{':
241 case '[':
242 return newToken('punctuator', read())
243
244 case 'n':
245 read()
246 literal('ull')
247 return newToken('null', null)
248
249 case 't':
250 read()
251 literal('rue')
252 return newToken('boolean', true)
253
254 case 'f':
255 read()
256 literal('alse')
257 return newToken('boolean', false)
258
259 case '-':
260 case '+':
261 if (read() === '-') {
262 sign = -1
263 }
264
265 lexState = 'sign'
266 return
267
268 case '.':
269 buffer = read()
270 lexState = 'decimalPointLeading'
271 return
272
273 case '0':
274 buffer = read()
275 lexState = 'zero'
276 return
277
278 case '1':
279 case '2':
280 case '3':
281 case '4':
282 case '5':
283 case '6':
284 case '7':
285 case '8':
286 case '9':
287 buffer = read()
288 lexState = 'decimalInteger'
289 return
290
291 case 'I':
292 read()
293 literal('nfinity')
294 return newToken('numeric', Infinity)
295

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…