MCPcopy Create free account
hub / github.com/bazelbuild/bazel / assign

Method assign

src/main/java/net/starlark/java/syntax/Resolver.java:596–612  ·  view source on GitHub ↗
(Expression lhs)

Source from the content-addressed store, hash-verified

594 }
595
596 private void assign(Expression lhs) {
597 if (lhs instanceof Identifier) {
598 // Bindings are created by the first pass (createBindings),
599 // so there's nothing to do here.
600 } else if (lhs instanceof IndexExpression) {
601 visit(lhs);
602 } else if (lhs instanceof ListExpression) {
603 for (Expression elem : ((ListExpression) lhs).getElements()) {
604 assign(elem);
605 }
606 } else if (lhs instanceof DotExpression) {
607 visit(((DotExpression) lhs).getObject());
608 // Do not visit the field. It is an identifier but does not correspond to a binding.
609 } else {
610 errorf(lhs, "cannot assign to '%s'", lhs);
611 }
612 }
613
614 @Override
615 public void visit(Identifier id) {

Callers 1

visitMethod · 0.95

Calls 4

visitMethod · 0.95
errorfMethod · 0.95
getElementsMethod · 0.80
getObjectMethod · 0.65

Tested by

no test coverage detected