Пример #1
0
        ///////////////////////////////////////////////////////////////////////

        public override ReturnCode GetVariable(
            ICallFrame frame,
            string varName,
            string varIndex,
            ref VariableFlags flags,
            ref IVariable variable,
            ref Result error
            )
        {
            IResolve resolve = null;
            string   tail    = null;

            INamespace @namespace = GetNamespaceForVariable(
                frame, varName, ref resolve, ref tail, ref error);

            if (@namespace != null)
            {
                if (resolve != null)
                {
                    return(resolve.GetVariable(
                               frame, tail, varIndex, ref flags, ref variable,
                               ref error));
                }
                else
                {
                    Interpreter interpreter = base.Interpreter;

                    if (!NamespaceOps.IsGlobal(interpreter, @namespace))
                    {
                        frame = @namespace.VariableFrame;

                        return(base.GetVariable(
                                   frame, tail, varIndex, ref flags, ref variable,
                                   ref error));
                    }
                }
            }

            return(base.GetVariable(
                       frame, varName, varIndex, ref flags, ref variable,
                       ref error));
        }