vars.$id = $value
165300
function makeVar(id, expr) {
  return assignmentExpression('=',
    memberExpression(identifier('vars'), literal(id), true),
    expr);
}
552660
public function share(string $id, Closure $value, array $tags = []): void
    {
        $value = function ($container) use ($value) {
            static $sharedValue;

            if ($sharedValue === null) {
                $sharedValue = $value($container);
            }

            return $sharedValue;
        };
        $this->set($id, $value, $tags);
    }
904949
public function set($id, $value = null)
    {
        if ($this->locked) {
            return false;
        }

        if (is_array($id)) {
            foreach ($id as $k => $v) {
                $this->set($k, $v);
            }
        } elseif (is_string($id)) {
            return $this->setItem($id, $value);
        } else {
            return false;
        }
    }
912807
private function _iterate($key, $value)
    {

        if (!is_array($value)) {
            if (is_string($value)) {

                if ($filter = $this->_detect($key, $value)) {
                    include_once 'IDS/Event.php';
                    $this->report->addEvent(
                        new IDS_Event(
                            $key,
                            $value,
                            $filter
                        )
                    );
                }
            }
        } else {
            foreach ($value as $subKey => $subValue) {
                $this->_iterate($key . '.' . $subKey, $subValue);
            }
        }
    }
1295090
function append($tpl_var, $value=null, $merge=false)
	{
		if (is_array($tpl_var)) {
			// $tpl_var is an array, ignore $value
			foreach ($tpl_var as $_key => $_val) {
				if ($_key != '') {
					if(!@is_array($this->_tpl_vars[$_key])) {
						settype($this->_tpl_vars[$_key],'array');
					}
					if($merge && is_array($_val)) {
						foreach($_val as $_mkey => $_mval) {
							$this->_tpl_vars[$_key][$_mkey] = $_mval;
						}
					} else {
						$this->_tpl_vars[$_key][] = $_val;
					}
				}
			}
		} else {
			if ($tpl_var != '' && isset($value)) {
				if(!@is_array($this->_tpl_vars[$tpl_var])) {
					settype($this->_tpl_vars[$tpl_var],'array');
				}
				if($merge && is_array($value)) {
					foreach($value as $_mkey => $_mval) {
						$this->_tpl_vars[$tpl_var][$_mkey] = $_mval;
					}
				} else {
					$this->_tpl_vars[$tpl_var][] = $value;
				}
			}
		}
	}
191472
def declare_vars(self, d):
        """"""
        for k, v in d.items():
            self.declare_var(k, v)
318820
def AssignVar(self, value):
    """"""
    self.value = value
    # Call OnAssignVar on options.
    [option.OnAssignVar() for option in self.options]
69203
function $var(params, fn, envs) {
    if (params == null) {
        return params;
    }
    if (typeof params === 'string') {
        if (envs && envs[params] !== undefined) {
            return envs[params];
        }

        return;
    }
    if (Array.isArray(params) && params.length === 2) {
        const key = params[0];
        if (typeof key === 'string') {
            const value = fn.$var(key, fn, envs);

            return value === undefined ? params[1] : value;
        }
    }
    throw new Error(
        '$var expects a string or an array with two elements of which the first one must be a string'
    );
}
412209
public function assign($var, $value = null)
    {
        if (is_string($var)) {
            $this->_vars[$var] = $value;

            return $this;
        }

        if (is_array($var)) {
            foreach ($var as $key => $value) {
                if ($value instanceof AbstractClassContent) {
                    // trying to load subcontent
                    $subcontent = $this->getApplication()
                            ->getEntityManager()
                            ->getRepository(ClassUtils::getRealClass($value))
                            ->load($value, $this->getApplication()->getBBUserToken());
                    if (null !== $subcontent) {
                        $value = $subcontent;
                    }
                }

                $this->_vars[$key] = $value;
            }
        }

        return $this;
    }
514171
function replaceVars(value, vars) {
        if (typeof value != "string") {
          value = value(vars);
        } else if (vars) {
          value = value.replace(/%(\w+)/g, function (str, name) {
            return vars[name] || str;
          });
        }

        return value;
      }
611527
public function setVars($vars)
    {
        // If vars is an array
        if (is_array($vars) && count($vars)) {
            // Iterate and set the var
            foreach ($vars as $key => $value) {
                $this->setVar($key, $value);
            }
        }
        return $this;
    }
242588
function variableAttribute( $var, $attrs )
    {
        foreach( $attrs as $attr )
        {
            if ( is_object( $var ) )
            {
                if ( $var->hasAttribute( $attr ) )
                {
                    $var = $var->attribute( $attr );
                }
                else
                {
                    return null;
                }
            }
            else if ( is_array( $var ) )
            {
                if ( isset( $var[$attr] ) )
                {
                    $var = $var[$attr];
                }
                else
                {
                    return null;
                }
            }
            else
            {
                return null;
            }
        }
        if ( isset( $var ) )
        {
            return $var;
        }

        return null;
    }
520350
def _transform(self, var):
        '''  '''
        self.collection.variables.pop(var.name)
        return var.values
402341
public function putVars($key, $value = null)
    {
        if (is_array($key)) {
            $variables = $key;
        } elseif (!is_null($value)) {
            $variables = [$key => $value];
        } else {
            throw new Exception('Try Assets::putVars(["foo" => "bar"]');
        }

        // First, we have to translate the variables
        // to something JS-friendly.
        $this->buildJavaScriptSyntax($variables);

        return $this;
    }
1218189
function(s) {
            var spl = s.split(constants.spDelim);
            this.id = spl[0];
            this.value = spl[1];
        }
1208365
def _AssignVar(self, matched, value):
    
    _value = self._GetValue(value)
    if _value is not None:
        _value.AssignVar(matched.group(value))
778580
public function &variable($name, $value, $defer=false, $is_string = false)
    {
        if ($is_string == true) {
            $value = '"' . $value . '"';
        }

        $script = new JavascriptObject();

        $script->setType('var');
        $script->setScript([
            $name,
            $value
        ]);
        $script->setDefer($defer);

        $this->add($script);

        return $script;
    }