Esempio n. 1
0
 public Parser(NetRuby rb)
 {
     evalTree = null;
     ruby = rb;
     thread = rb.GetCurrentContext();
     compile_for_eval = false;
 }
Esempio n. 2
0
 internal static void Init(NetRuby rb)
 {
     RThreadGroupClass t = new RThreadGroupClass(rb);
     t.DefineClass("ThreadGroup", rb.cObject);
     rb.cThreadGroup = t;
     t.DefineSingletonMethod("new", new RMethod(tg_new), -1);
     t.DefineMethod("list", new RMethod(list), 0);
     t.DefineMethod("add", new RMethod(add), 1);
     RThreadGroup rg = (RThreadGroup)tg_new(t);
     t.ConstSet(rb.intern("Default"), rg);
     rg.Add(rb.GetCurrentContext());
 }
Esempio n. 3
0
 static internal RThread Start(NetRuby ruby, object[] args)
 {
     RThread parent = ruby.GetCurrentContext();
     RThread thrd = (RThread)parent.Clone();
     return thrd.Start(args);
 }
Esempio n. 4
0
 static private void matchSetter(object val, uint id, GlobalEntry gb, NetRuby rb)
 {
     rb.CheckType(val, typeof(RMatchData));
     RThread th = rb.GetCurrentContext();
     th.BackRef = val;
 }
Esempio n. 5
0
 static private object lastParenGetter(uint id, GlobalEntry gb, NetRuby rb)
 {
     RThread th = rb.GetCurrentContext();
     RMatchData m = (RMatchData)th.BackRef;
     if (m == null) return null;
     string s = m.Last;
     if (m.IsTainted)
         return new RString(rb, s, true);
     return s;
 }
Esempio n. 6
0
 static private object matchGetter(uint id, GlobalEntry gb, NetRuby rb)
 {
     RThread th = rb.GetCurrentContext();
     object o = th.BackRef;
     matchBusy(o);
     return o;
 }
Esempio n. 7
0
 static private object errInfoGetter(uint i, GlobalEntry gb, NetRuby rb)
 {
     RThread th = rb.GetCurrentContext();
     return th.errInfo;
 }
Esempio n. 8
0
 static private void errInfoSetter(object val, uint id, GlobalEntry gb, NetRuby rb)
 {
     RThread th = rb.GetCurrentContext();
     if (val != null)
     {
         RBasic b = rb.InstanceOf(val);
         if (b.IsKindOf(rb.eException) == false)
             throw new eTypeError("assigning non-exception to $!");
     }
     th.errInfo = (RException)val;
 }
Esempio n. 9
0
 static private void errAtSetter(object val, uint id, GlobalEntry gb, NetRuby rb)
 {
     RThread th = rb.GetCurrentContext();
     if (th.errInfo == null)
     {
         throw new ArgumentException("$! not set");
     }
     RException.exc_set_backtrace(th.errInfo, val);
 }
Esempio n. 10
0
 static private object errAtGetter(uint id, GlobalEntry gb, NetRuby rb)
 {
     RThread th = rb.GetCurrentContext();
     if (th.errInfo != null)
     {
         return th.errInfo.Backtrace;
     }
     return null;
 }