Creates a code chunk that assigns value to a preexisting variable with the given name.
182886
public static Statement assign(Expression lhs, Expression rhs) {
    return Assignment.create(lhs, rhs, null);
  }
429788
protected void setVariable(String variableName, Object value, ExecutionEntity sourceExecution, boolean fetchAllVariables) {

    if (fetchAllVariables == true) {

      // If it's in the cache, it's more recent
      if (usedVariablesCache.containsKey(variableName)) {
        updateVariableInstance(usedVariablesCache.get(variableName), value, sourceExecution);
      }

      // If the variable exists on this scope, replace it
      if (hasVariableLocal(variableName)) {
        setVariableLocal(variableName, value, sourceExecution, true);
        return;
      }

      // Otherwise, go up the hierarchy (we're trying to put it as high as possible)
      VariableScopeImpl parentVariableScope = getParentVariableScope();
      if (parentVariableScope != null) {
        if (sourceExecution == null) {
          parentVariableScope.setVariable(variableName, value);
        } else {
          parentVariableScope.setVariable(variableName, value, sourceExecution, true);
        }
        return;
      }

      // We're as high as possible and the variable doesn't exist yet, so
      // we're creating it
      if (sourceExecution != null) {
        createVariableLocal(variableName, value, sourceExecution);
      } else {
        createVariableLocal(variableName, value);
      }

    } else {

      // Check local cache first
      if (usedVariablesCache.containsKey(variableName)) {

        updateVariableInstance(usedVariablesCache.get(variableName), value, sourceExecution);

      } else if (variableInstances != null && variableInstances.containsKey(variableName)) {

        updateVariableInstance(variableInstances.get(variableName), value, sourceExecution);

      } else {

        // Not in local cache, check if defined on this scope
        // Create it if it doesn't exist yet
        VariableInstanceEntity variable = getSpecificVariable(variableName);
        if (variable != null) {
          updateVariableInstance(variable, value, sourceExecution);
          usedVariablesCache.put(variableName, variable);
        } else {

          VariableScopeImpl parent = getParentVariableScope();
          if (parent != null) {
            if (sourceExecution == null) {
              parent.setVariable(variableName, value, fetchAllVariables);
            } else {
              parent.setVariable(variableName, value, sourceExecution, fetchAllVariables);
            }

            return;
          }

          variable = createVariableInstance(variableName, value, sourceExecution);
          usedVariablesCache.put(variableName, variable);

        }

      }

    }

  }
1280224
public void setVariable(String name, Object value) {
        if (variables == null)
            variables = new LinkedHashMap();
        variables.put(name, value);
    }
1135488
function (name, value) {
			var options = this.options;

			if (value === void 0) {
				return options[name];
			} else {
				options[name] = value;
			}
		}
482223
public void put(String name, Scriptable start, Object value) {
        if (start == this) {
            synchronized (this) {
                if (isEmpty(name)) {
                    indexedProps.put(name, value);
                } else {
                    synchronized (context) {
                        int scope = context.getAttributesScope(name);
                        if (scope == -1) {
                            scope = ScriptContext.ENGINE_SCOPE;
                        }
                        context.setAttribute(name, jsToJava(value), scope);
                    }
                }
            }
        } else {
            start.put(name, start, value);
        }
    }
455451
protected Variable createVariable(final String name, final Object value,
            final Modifiers mods) throws UtilEvalError {
        return this.createVariable(name, null/* type */, value, mods);
    }
13360
public Operation.Info create( String name , Variable var0 ) {
        Input1 func = input1.get(name);
        if( func == null )
            return null;
        return func.create(var0,managerTemp);
    }
1301401
def _assign_values_to_unbound_vars(unbound_vars, unbound_var_values):
  """"""
  context = {}
  for key, value in six.iteritems(unbound_var_values):
    if key not in unbound_vars:
      raise ValueError('unexpected key: %s. Legal values are: %s' %
                       (key, list(six.iterkeys(unbound_vars))))
    context[unbound_vars[key]] = value
  unspecified = []
  for unbound_var in six.itervalues(unbound_vars):
    if unbound_var not in context:
      if unbound_var.has_default():
        context[unbound_var] = unbound_var.default
      else:
        unspecified.append(unbound_var.key)
  if unspecified:
    raise ValueError('Unspecified keys: %s' % unspecified)
  return context
1374816
public synchronized Object put(Object name,Object value)
    {
        if (_initParams==null)
            _initParams=new HashMap(3);
        return _initParams.put(name,value);
    }
670735
private void initIndexVariable(String name, TemplateParserContext context) {
    this.indexVariableInfo = context.addLocalVariable("int", name.trim());
  }
1334848
private static Node varToAssign(Node var) {
    Node assign =
        IR.assign(var.getFirstChild().cloneNode(), var.getFirstChild().removeFirstChild());
    return IR.exprResult(assign).useSourceInfoIfMissingFromForTree(var);
  }
1039371
@SuppressWarnings({"unchecked", "rawtypes"})
    public Object assign( Object val, boolean strictJava )
        throws UtilEvalError
    {
        if ( type == VARIABLE )
        {
            // Set the variable in namespace according to localVar flag
            if ( localVar )
                nameSpace.setLocalVariableOrProperty( varName, val, strictJava );
            else
                nameSpace.setVariableOrProperty( varName, val, strictJava );
        } else  if ( type == FIELD )  try {
            Objects.requireNonNull(field).invoke( object, val );
            return val;
        }
        catch( NullPointerException e ) {
            throw new UtilEvalError(
                "LHS ("+field.getName()+") not a static field.", e);
        }
        catch( ReflectiveOperationException e2 ) {
            throw new UtilEvalError(
                "LHS ("+field.getName()+") can't access field: "+e2, e2);
        }
        catch( IllegalArgumentException e3 )
        {
            String type = val == null ? "null"
                : Types.getType(val).getSimpleName();
            throw new UtilEvalError(
                "Argument type mismatch. " + type
                + " not assignable to field "+field.getName(), e3);
        } else if ( type == PROPERTY ) try {
            if (propName instanceof String)
                return  Reflect.setObjectProperty(object, (String) propName, val);
            return  Reflect.setObjectProperty(object, propName, val);
        } catch(ReflectError e) {
            Interpreter.debug("Assignment: " + e.getMessage());
            throw new UtilEvalError("No such property: " + propName, e);
        }
        else if ( type == INDEX ) try {
            if ( object.getClass().isArray() && val != null ) try {
                val = Types.castObject( val,
                      Types.arrayElementType(object.getClass()),
                      Types.ASSIGNMENT);
            } catch (Exception e) { /* ignore cast exceptions */ }

            BshArray.setIndex(object, index, val);
        } catch ( UtilTargetError e1 ) { // pass along target error
            if ( IndexOutOfBoundsException.class.isAssignableFrom(e1.getCause().getClass()) )
                throw new UtilEvalError("Error array set index: "+e1.getMessage(), e1);
            throw e1;
        } catch ( Exception e ) {
            throw new UtilEvalError("Assignment: " + e.getMessage(), e);
        } else if ( type == LOOSETYPE_FIELD ) {
            Modifiers mods = new Modifiers(Modifiers.FIELD);
            mods.addModifier("public");
            if ( nameSpace.isInterface )
                mods.setConstant();
            nameSpace.setTypedVariable(varName, Types.getType(val), val, mods);
            return val;
        } else if ( type == MAP_ENTRY ) {
            if ( object instanceof Entry )
                return ((Entry) object).setValue(val);
            // returns a Map.Entry of key and value pair
            return new MapEntry(object, val);
        } else
            throw new InterpreterError("unknown lhs type");
        return val;
    }
1235032
public Operation.Info create( String name , List<Variable> vars ) {
        InputN func = inputN.get(name);
        if( func == null )
            return null;
        return func.create(vars,managerTemp);
    }
898563
private SomeCommandAnnotatedObject create(final String name, ExecutionContext executionContext) {
        return executionContext.add(this, someCommandAnnotatedObjects.create(name));
    }
1212356
function(name, value) {
      var lcname = name.toLowerCase();
      if (typeof value === "string" &&
          lcname in this._designSet.param &&
          'multiValue' in this._designSet.param[lcname]) {
          value = [value];
      }
      this.jCal[PROP_INDEX][name] = value;
    }
1238451
public Variable variable(final String name) {
    Variable var = this.posLiterals.get(name);
    if (var == null) {
      var = new Variable(name, this);
      this.posLiterals.put(name, var);
    }
    return var;
  }
1156435
private Chunk setAttribute(String name, Object obj) {
		if (attributes == null)
			attributes = new HashMap();
		attributes.put(name, obj);
		return this;
	}