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

Function string

lib/parse.js:570–609  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

568 },
569
570 string () {
571 switch (c) {
572 case '\\':
573 read()
574 buffer += escape()
575 return
576
577 case '"':
578 if (doubleQuote) {
579 read()
580 return newToken('string', buffer)
581 }
582
583 buffer += read()
584 return
585
586 case "'":
587 if (!doubleQuote) {
588 read()
589 return newToken('string', buffer)
590 }
591
592 buffer += read()
593 return
594
595 case '\n':
596 case '\r':
597 throw invalidChar(read())
598
599 case '\u2028':
600 case '\u2029':
601 separatorChar(c)
602 break
603
604 case undefined:
605 throw invalidChar(read())
606 }
607
608 buffer += read()
609 },
610
611 start () {
612 switch (c) {

Callers

nothing calls this directly

Calls 5

readFunction · 0.85
escapeFunction · 0.85
newTokenFunction · 0.85
invalidCharFunction · 0.85
separatorCharFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…