Esempio n. 1
0
 object f_load(RBasic r, params object[] args)
 {
     object[] argv = new object[2];
     ruby.ScanArgs(args, "11", argv);
     ruby.Load(argv[0], RBasic.RTest(argv[1]));
     return(true);
 }
Esempio n. 2
0
        static internal object thread_abort_set(RBasic r, params object[] args)
        {
            bool b = RBasic.RTest(args[0]);

            ((RThread)r).AbortOnException = b;
            return(b);
        }
Esempio n. 3
0
        static internal object thread_s_abort_set(RBasic r, params object[] args)
        {
            NetRuby rb = r.ruby;
            bool    b  = RBasic.RTest(args[0]);

            rb.cThread.AbortOnException = b;
            return(b);
        }
Esempio n. 4
0
        public object attr(RBasic r, params object[] o)
        {
            object[] argv = new object[2];
            ruby.ScanArgs(o, "11", argv);
            uint id = ruby.ToID(argv[0]);

            ((RMetaObject)r).Attribute(ruby.ToID(argv[0]), true, RBasic.RTest(argv[1]), true);
            return(null);
        }
Esempio n. 5
0
        static internal object initialize(RBasic r, params object[] args)
        {
            if (args.Length < 1 || args.Length > 3)
            {
                throw new eArgError("wrong # of argument");
            }
            RegexOptions flag = RegexOptions.None;

            if (args.Length >= 2)
            {
                if (args[1] is int || args[1] is RegexOptions)
                {
                    flag = (RegexOptions)(int)args[1];
                }
                else if (args[1] is RFixnum)
                {
                    flag = (RegexOptions)((RFixnum)args[1]).ToInt();
                }
                else if (RBasic.RTest(args[1]))
                {
                    flag = RegexOptions.IgnoreCase;
                }
            }
            if (args.Length == 3)
            {
                // ignore char set
            }
            NetRuby ruby = r.ruby;
            RRegexp self = (RRegexp)r;

            if (args[0] is RRegexp)
            {
                RRegexp re = (RRegexp)args[0];
                re.Check();
                self.Initialize(re, flag);
            }
            else
            {
                string p = RString.ToString(ruby, args[0]);
                self.Initialize(p, flag);
            }
            return(self);
        }
Esempio n. 6
0
 static private void  iCaseSetter(object val, uint id, GlobalEntry gb, NetRuby rb)
 {
     rb.cRegexp.IsIgnoreCase = RBasic.RTest(val);
 }