示例#1
0
        public static object gvar_set(string gvar_name, object value, Frame caller)
        {
            if (!global_vars.ContainsKey(gvar_name))
                global_vars[gvar_name] = new global_variable();

            global_vars[gvar_name].setter(gvar_name, value, caller);
            
            return value;
        }
示例#2
0
        internal static void rb_define_variable(string name, global_variable var)
        {
            global_vars[name] = var;

        }
示例#3
0
 internal static void opt_i_set(object value, string id, object data, global_variable var)
 {
     if (!Eval.Test(value))
     {
         ruby_inplace_mode = null;
     }
     else
     {
         ruby_inplace_mode = String.StringValue(value, null); // fixme: might need a valid frame to call StringValue
     }
 }
示例#4
0
 internal static object opt_i_get(string id, object data, global_variable var)
 {
     if (ruby_inplace_mode == null)
         return null;
     else
         return new String((string)ruby_inplace_mode);
 }
示例#5
0
 internal static void deferr_setter(Frame caller, object value, string id, object data, global_variable var)
 {
     stdout_setter(caller, value, id, data, var);
     Errors.rb_warn("$deferr is obsolete; use $stderr instead");
 }
示例#6
0
 internal static void stdout_setter(Frame caller, object value, string id, object data, global_variable var)
 {
     must_respond_to(caller, "write", value, id);
     var.value = value;
 }
示例#7
0
        // ----------------------------------------------------------------------------


        internal static void lineno_setter(object value, string id, object data, global_variable var)
        {
            gets_lineno = Integer.rb_num2long(value, null);
            var.value = gets_lineno;
        }