private EnvVar getEnvVar(bool isOutputNotice)
        {
            if (_var == null)
            {
                _var = Env.getInstance().getEnvVar(_name, true, isOutputNotice);
            }

            return(_var);
        }
        /**
         * Gets a new value.
         */
        public Value containsKey(Value key)
        {
            EnvVar var = _env.getGlobalEnv().get(key.ToStringValue());

            if (var != null)
            {
                return(var.get());
            }
            else
            {
                return(null);
            }
        }
Пример #3
0
        private void saveGlobals(Env env, Map <StringValue, EnvVar> globalMap)
        {
            _globalValues = new Value[globalMap.size()];

            for (Map.Entry <StringValue, EnvVar> entry : globalMap.entrySet())
            {
                if (env.isSpecialVar(entry.getKey()))
                {
                    continue;
                }

                EnvVar envVar = entry.getValue();

                int id = addGlobalName(entry.getKey());

                _globalValues[id] = envVar.get().copy(env);
            }
        }
        /**
         * Returns true if the key exists in the array.
         */
        public bool keyExists(Value key)
        {
            EnvVar var = _env.getGlobalEnv().get(key.ToStringValue());

            return(var != null);
        }