MCPcopy Index your code
hub / github.com/lutzroeder/netron / emitExprsAssign

Method emitExprsAssign

source/python.js:17293–17355  ·  view source on GitHub ↗
(lhs_exprs, outputs /*, rhs_loc, n_binders */)

Source from the content-addressed store, hash-verified

17291 }
17292 }
17293 emitExprsAssign(lhs_exprs, outputs /*, rhs_loc, n_binders */) {
17294 let i = 0;
17295 for (const assignee of lhs_exprs) {
17296 if (assignee instanceof ast.Subscript) {
17297 throw new python.Error('Not implemented.');
17298 /*
17299 this.emitSubscriptAssign(
17300 rhs_loc,
17301 Subscript(assignee),
17302 NamedValue(rhs_loc, outputs.at(i).asValue(rhs_loc, method)));
17303 i++;
17304 */
17305 } else if (assignee instanceof ast.Name) {
17306 this.environment_stack.setSugaredVar(assignee.range(), assignee.id, outputs[i], /*annotated_type=*/null);
17307 i++;
17308 } else if (assignee instanceof ast.Starred) {
17309 throw new python.Error('Not implemented.');
17310 /*
17311 const var = Starred(assignee).expr();
17312 if (var.kind() != TK_VAR) {
17313 throw(
17314 ErrorReport(var) << 'Cannot pack a tuple into a non-variable');
17315 }
17316 size_t n_matched = outputs.size() - n_binders;
17317 ArrayRef<std::shared_ptr<SugaredValue>> outputs_ref = outputs;
17318 const values = fmap(
17319 outputs_ref.slice(i, n_matched),
17320 [&](const std::shared_ptr<SugaredValue>& v) {
17321 return v.asValue(assignee.range(), method);
17322 });
17323 const tup = graph.insertNode(graph.createTuple(values)).output();
17324 environment_stack.setVar(var.range(), Var(var).name().name(), tup);
17325 i += n_matched;
17326 */
17327 } else if (assignee instanceof ast.Tuple) {
17328 throw new python.Error('Not implemented.');
17329 /*
17330 // recursively emit tuple assignments on tuple literal input
17331 TupleLiteral sub_tl = TupleLiteral(assignee);
17332 size_t sub_n_binders = sub_tl.inputs().length;
17333 bool sub_starred_unpack =
17334 validateAssignLhsExpr(sub_tl.inputs(), sub_tl.range());
17335 if (sub_starred_unpack)
17336 sub_n_binders--;
17337 emitTupleAssign(
17338 sub_tl,
17339 outputs.at(i),
17340 rhs_loc,
17341 sub_n_binders,
17342 sub_starred_unpack);
17343 i++;
17344 */
17345 } else if (assignee instanceof ast.Attribute) {
17346 throw new python.Error('Not implemented.');
17347 /*
17348 emitSelectAssign(assignee, outputs.at(i), rhs_loc);
17349 i++;
17350 */

Callers 2

emitLoopCommonMethod · 0.80
emitTupleAssignMethod · 0.80

Calls 1

setSugaredVarMethod · 0.80

Tested by

no test coverage detected