MCPcopy Create free account
hub / github.com/nodejs/node / addSyntheticNodes

Function addSyntheticNodes

test/fixtures/snapshot/typescript.js:164041–164057  ·  view source on GitHub ↗
(nodes, pos, end, parent)

Source from the content-addressed store, hash-verified

164039 return children;
164040 }
164041 function addSyntheticNodes(nodes, pos, end, parent) {
164042 ts.scanner.setTextPos(pos);
164043 while (pos < end) {
164044 var token = ts.scanner.scan();
164045 var textPos = ts.scanner.getTextPos();
164046 if (textPos <= end) {
164047 if (token === 79 /* SyntaxKind.Identifier */) {
164048 ts.Debug.fail("Did not expect ".concat(ts.Debug.formatSyntaxKind(parent.kind), " to have an Identifier in its trivia"));
164049 }
164050 nodes.push(createNode(token, pos, textPos, parent));
164051 }
164052 pos = textPos;
164053 if (token === 1 /* SyntaxKind.EndOfFileToken */) {
164054 break;
164055 }
164056 }
164057 }
164058 function createSyntaxList(nodes, parent) {
164059 var list = createNode(348 /* SyntaxKind.SyntaxList */, nodes.pos, nodes.end, parent);
164060 list._children = [];

Callers 4

processNodeFunction · 0.85
processNodesFunction · 0.85
createChildrenFunction · 0.85
createSyntaxListFunction · 0.85

Calls 4

concatMethod · 0.80
createNodeFunction · 0.70
failMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected