//System.out.println("LASGN1: " + name + ", l: " + depth + ", i: " + slot);
// mark as captured if from containing scope
if (depth > 0) capture(slot);
return new LocalAsgnNode(position, name, ((depth << 16) | slot), value);
} else if (topScope == this) {
slot = addVariable(name);
//System.out.println("LASGN2: " + name + ", l: " + depth + ", i: " + slot);
return new LocalAsgnNode(position, name, slot , value);
}
// We know this is a block scope because a local scope cannot be within a local scope
// If topScope was itself it would have created a LocalAsgnNode above.
return ((BlockStaticScope) topScope).addAssign(position, name, value);