MCPcopy Create free account
hub / github.com/davidkingzyb/SCAST / parseIdent

Function parseIdent

lib/filbert.js:2689–2704  ·  view source on GitHub ↗
(liberal)

Source from the content-addressed store, hash-verified

2687 // TODO: liberal?
2688
2689 function parseIdent(liberal) {
2690 var node = startNode();
2691 if (liberal) liberal = false;
2692 if (tokType === _name) {
2693 if (!liberal && strict && input.slice(tokStart, tokEnd).indexOf("\\") == -1)
2694 raise(tokStart, "The keyword '" + tokVal + "' is reserved");
2695 node.name = tokVal;
2696 } else if (liberal && tokType.keyword) {
2697 node.name = tokType.keyword;
2698 } else {
2699 unexpected();
2700 }
2701 tokRegexpAllowed = false;
2702 next();
2703 return finishNode(node, "Identifier");
2704 }
2705
2706 function parseTuple(noIn, expr) {
2707 var node = expr ? startNodeFrom(expr) : startNode();

Callers 7

parseStatementFunction · 0.85
parseSubscriptsFunction · 0.85
parseExprAtomFunction · 0.85
parseClassFunction · 0.85
parseDictFunction · 0.85
parsePropertyNameFunction · 0.85
parseFunctionFunction · 0.85

Calls 5

startNodeFunction · 0.85
raiseFunction · 0.85
finishNodeFunction · 0.85
unexpectedFunction · 0.70
nextFunction · 0.70

Tested by

no test coverage detected