当前位置: 首页>>代码示例>>C#>>正文


C# Frame.nesting方法代码示例

本文整理汇总了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);
 }
开发者ID:chunlea,项目名称:rubydotnetcompiler,代码行数:9,代码来源:Proc.cs

示例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);
 }
开发者ID:chunlea,项目名称:rubydotnetcompiler,代码行数:8,代码来源:Class.cs

示例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];
        }
开发者ID:chunlea,项目名称:rubydotnetcompiler,代码行数:9,代码来源:Eval.cs

示例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);
        }
开发者ID:chunlea,项目名称:rubydotnetcompiler,代码行数:10,代码来源:Eval.cs

示例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);
        }
开发者ID:chunlea,项目名称:rubydotnetcompiler,代码行数:10,代码来源:Eval.cs

示例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);
     }
 }
开发者ID:chunlea,项目名称:rubydotnetcompiler,代码行数:13,代码来源:Class.cs

示例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;
        }
开发者ID:chunlea,项目名称:rubydotnetcompiler,代码行数:15,代码来源:Class.cs


注:本文中的Ruby.Runtime.Frame.nesting方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。