MCPcopy Create free account
hub / github.com/json5/json5 / beforePropertyName

Function beforePropertyName

lib/parse.js:625–655  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

623 },
624
625 beforePropertyName () {
626 switch (c) {
627 case '$':
628 case '_':
629 buffer = read()
630 lexState = 'identifierName'
631 return
632
633 case '\\':
634 read()
635 lexState = 'identifierNameStartEscape'
636 return
637
638 case '}':
639 return newToken('punctuator', read())
640
641 case '"':
642 case "'":
643 doubleQuote = (read() === '"')
644 lexState = 'string'
645 return
646 }
647
648 if (util.isIdStartChar(c)) {
649 buffer += read()
650 lexState = 'identifierName'
651 return
652 }
653
654 throw invalidChar(read())
655 },
656
657 afterPropertyName () {
658 if (c === ':') {

Callers

nothing calls this directly

Calls 5

readFunction · 0.85
newTokenFunction · 0.85
invalidCharFunction · 0.85
popFunction · 0.85
invalidEOFFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…