本文整理汇总了C#中Ruby.Runtime.Frame.nesting方法的典型用法代码示例。如果您正苦于以下问题:C# Frame.nesting方法的具体用法?C# Frame.nesting怎么用?C# Frame.nesting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ruby.Runtime.Frame
的用法示例。
在下文中一共展示了Frame.nesting方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: yield
public object yield(Frame caller, ArgList args)
{
args.block = this.block;
// return body.Calln(my_class, self, caller, args); // BBTAG: last_class should be nearest lexical class definition rather than Proc
Class last_class = Init.rb_cObject;
if (caller != null && caller.nesting().Length > 0)
last_class = caller.nesting()[0];
return body.Calln(last_class, self, caller, args);
}
示例2: Call0
public override object Call0(Class last_class, object recv, Frame caller, Proc block)
{
Class[] nesting = caller.nesting();
if (nesting == null)
return new Array();
else
return new Array(nesting);
}
示例3: ruby_cbase
// ruby_cbase: gets the class attached to the current 'node' (i.e. the current lexical context)
internal static Class ruby_cbase(Frame caller) {
Class[] nesting = caller.nesting();
if (nesting == null || nesting.Length == 0)
return Ruby.Runtime.Init.rb_cObject;
return nesting[0];
}
示例4: const_get
internal static object const_get(Class current, string id, Frame caller) {
if (current.const_defined(id, false))
return current.const_get(id, caller);
foreach (Class klass in caller.nesting())
if (klass.const_defined(id, false))
return klass.const_get(id, caller);
return current.const_get(id, caller);
}
示例5: const_defined
internal static bool const_defined(Class current, string id, Frame caller) {
if (current.const_defined(id, false))
return true;
foreach (Class klass in caller.nesting())
if (klass.const_defined(id, false))
return true;
return current.const_defined(id, true);
}
示例6: add_method
internal void add_method(string name, MethodBody body, int arity, Frame caller)
{
if (caller != null && caller.scope_vmode == Access.ModuleFunction &&
caller.nesting().Length > 0 && caller.nesting()[0] == this)
{
add_method(name, body, arity, Access.Private, caller);
Class.rb_define_singleton_method(this, name, body, arity, caller);
}
else
{
add_method(name, body, arity, get_visibility_mode(caller), caller);
}
}
示例7: get_visibility_mode
internal Access get_visibility_mode(Frame caller)
{
Access access = Access.Public;
Class nesting = Init.rb_cObject;
if (caller != null)
{
if (caller.nesting().Length > 0)
nesting = caller.nesting()[0];
if (nesting == this)
access = caller.scope_vmode;
}
return access;
}