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

Method emitSelectAssign

source/python.js:17257–17268  ·  view source on GitHub ↗
(lhs, rhs, type, loc)

Source from the content-addressed store, hash-verified

17255 }
17256 }
17257 emitSelectAssign(lhs, rhs, type, loc) {
17258 if (!rhs) {
17259 throw new python.Error('Expected RHS for assignment.');
17260 }
17261 let type_hint = null;
17262 if (type) {
17263 type_hint = this._typeParser.parseTypeFromExpr(type);
17264 }
17265 const lhsObject = this.emitSugaredExpr(lhs.value, 1);
17266 const rhsValue = this.emitSugaredExpr(rhs, 1, type_hint).asValue(rhs.range(), this.method);
17267 lhsObject.setAttr(loc, this.method, lhs.attr, rhsValue);
17268 }
17269 emitTupleAssign(...args) {
17270 if (args.length === 2) {
17271 const [tl, rhs] = args;

Callers 1

emitSingleAssignmentMethod · 0.80

Calls 4

parseTypeFromExprMethod · 0.80
emitSugaredExprMethod · 0.80
asValueMethod · 0.80
setAttrMethod · 0.80

Tested by

no test coverage detected