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

Function parseTuple

lib/filbert.js:2706–2731  ·  view source on GitHub ↗
(noIn, expr)

Source from the content-addressed store, hash-verified

2704 }
2705
2706 function parseTuple(noIn, expr) {
2707 var node = expr ? startNodeFrom(expr) : startNode();
2708 node.arguments = expr ? [expr] : [];
2709
2710 // Tuple with single element has special trailing comma: t = 'hi',
2711 // Look ahead and eat comma in this scenario
2712 if (tokType === _comma) {
2713 var oldPos = tokPos; skipSpace();
2714 var newPos = tokPos; tokPos = oldPos;
2715 if (newPos >= inputLen || input[newPos] === ';' || input[newPos] === ')' || newline.test(input[newPos]))
2716 eat(_comma);
2717 }
2718
2719 while (eat(_comma)) {
2720 node.arguments.push(parseExprOps(noIn));
2721 }
2722 finishNode(node, "NewExpression");
2723
2724 var runtimeId = nc.createNodeSpan(node, node, "Identifier", { name: options.runtimeParamName });
2725 var objectsId = nc.createNodeSpan(node, node, "Identifier", { name: "objects" });
2726 var runtimeMember = nc.createNodeSpan(node, node, "MemberExpression", { object: runtimeId, property: objectsId, computed: false });
2727 var listId = nc.createNodeSpan(node, node, "Identifier", { name: "tuple" });
2728 node.callee = nc.createNodeSpan(node, node, "MemberExpression", { object: runtimeMember, property: listId, computed: false });
2729
2730 return node;
2731 }
2732
2733 // ## Python runtime library
2734

Callers 2

parseMaybeTupleFunction · 0.85
parseExprAtomFunction · 0.85

Calls 6

startNodeFromFunction · 0.85
startNodeFunction · 0.85
skipSpaceFunction · 0.85
eatFunction · 0.85
parseExprOpsFunction · 0.85
finishNodeFunction · 0.85

Tested by

no test coverage detected