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


C# Runtime.List类代码示例

本文整理汇总了C#中IronPython.Runtime.List的典型用法代码示例。如果您正苦于以下问题:C# List类的具体用法?C# List怎么用?C# List使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


List类属于IronPython.Runtime命名空间,在下文中一共展示了List类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Compare

 internal Compare(BinaryExpression expr, cmpop op)
     : this() {
     _left = Convert(expr.Left);
     _ops = PythonOps.MakeListNoCopy(op);
     _comparators = PythonOps.MakeListNoCopy(Convert(expr.Right));
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:6,代码来源:_ast.cs

示例2: BoolOp

 internal BoolOp(AndExpression and)
     : this() {
     _values = PythonOps.MakeListNoCopy(Convert(and.Left), Convert(and.Right));
     _op = And.Instance;
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:5,代码来源:_ast.cs

示例3: Call

            internal Call(CallExpression call)
                : this() {
                _args = PythonOps.MakeEmptyList(call.Args.Count);
                _keywords = new PythonList();
                _func = Convert(call.Target);
                foreach (IronPython.Compiler.Ast.Arg arg in call.Args) {

                    if (arg.Name == null)
                        _args.Add(Convert(arg.Expression));
                    else if (arg.Name == "*")
                        _starargs = Convert(arg.Expression);
                    else if (arg.Name == "**")
                        _kwargs = Convert(arg.Expression);
                    else
                        _keywords.Add(new keyword(arg));
                }
            }
开发者ID:rchandrashekara,项目名称:main,代码行数:17,代码来源:_ast.cs

示例4: Convert

            internal static PythonList Convert(ComprehensionIterator[] iters) {
                PythonList comps = new PythonList();
                int start = 1;
                for (int i = 0; i < iters.Length; i++) {
                    if (i == 0 || iters[i] is ComprehensionIf)
                        if (i == iters.Length - 1)
                            i++;
                        else
                            continue;

                    ComprehensionIf[] ifs = new ComprehensionIf[i - start];
                    Array.Copy(iters, start, ifs, 0, ifs.Length);
                    comps.Add(new comprehension((ComprehensionFor)iters[start - 1], ifs));
                    start = i + 1;
                }
                return comps;
            }
开发者ID:rchandrashekara,项目名称:main,代码行数:17,代码来源:_ast.cs

示例5: comprehension

 internal comprehension(ComprehensionFor listFor, ComprehensionIf[] listIfs)
     : this() {
     _target = Convert(listFor.Left, Store.Instance);
     _iter = Convert(listFor.List);
     _ifs = PythonOps.MakeEmptyList(listIfs.Length);
     foreach (ComprehensionIf listIf in listIfs)
         _ifs.Add(Convert(listIf.Test));
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:8,代码来源:_ast.cs

示例6: TryFinally

 internal TryFinally(PythonList body, PythonList finalbody)
     : this() {
     _body = body;
     _finalbody = finalbody;
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:5,代码来源:_ast.cs

示例7: FunctionDef

            internal FunctionDef(FunctionDefinition def)
                : this() {
                _name = def.Name;
                _args = new arguments(def.Parameters);
                _body = ConvertStatements(def.Body);

                if (def.Decorators != null) {
                    _decorators = PythonOps.MakeEmptyList(def.Decorators.Count);
                    foreach (Compiler.Ast.Expression expr in def.Decorators)
                        _decorators.Add(Convert(expr));
                } else
                    _decorators = PythonOps.MakeEmptyList(0);
            }
开发者ID:rchandrashekara,项目名称:main,代码行数:13,代码来源:_ast.cs

示例8: GeneratorExp

 internal GeneratorExp(GeneratorExpression expr)
     : this() {
     ExtractListComprehensionIterators walker = new ExtractListComprehensionIterators();
     expr.Function.Body.Walk(walker);
     ComprehensionIterator[] iters = walker.Iterators;
     Debug.Assert(iters.Length != 0, "A generator expression cannot have zero iterators.");
     iters[0] = new ComprehensionFor(((ComprehensionFor)iters[0]).Left, expr.Iterable);
     _elt = Convert(walker.Yield.Expression);
     _generators = Convert(iters);
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:10,代码来源:_ast.cs

示例9: ExtSlice

 internal ExtSlice(PythonList dims)
     : this() {
     _dims = dims;
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:4,代码来源:_ast.cs

示例10: For

 internal For(ForStatement stmt)
     : this() {
     _target = Convert(stmt.Left, Store.Instance);
     _iter = Convert(stmt.List);
     _body = ConvertStatements(stmt.Body);
     _orelse = ConvertStatements(stmt.Else, true);
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:7,代码来源:_ast.cs

示例11: Dict

 internal Dict(DictionaryExpression expr)
     : this() {
     _keys = PythonOps.MakeEmptyList(expr.Items.Count);
     _values = PythonOps.MakeEmptyList(expr.Items.Count);
     foreach (SliceExpression item in expr.Items) {
         _keys.Add(Convert(item.SliceStart));
         _values.Add(Convert(item.SliceStop));
     }
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:9,代码来源:_ast.cs

示例12: Delete

 internal Delete(DelStatement stmt)
     : this() {
     _targets = PythonOps.MakeEmptyList(stmt.Expressions.Count);
     foreach (Compiler.Ast.Expression expr in stmt.Expressions)
         _targets.Add(Convert(expr, Del.Instance));
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:6,代码来源:_ast.cs

示例13: Print

            internal Print(PrintStatement stmt)
                : this() {
                if (stmt.Destination != null)
                    _dest = Convert(stmt.Destination);

                _values = PythonOps.MakeEmptyList(stmt.Expressions.Count);
                foreach (Compiler.Ast.Expression expr in stmt.Expressions)
                    _values.Add(Convert(expr));

                _nl = !stmt.TrailingComma;
            }
开发者ID:rchandrashekara,项目名称:main,代码行数:11,代码来源:_ast.cs

示例14: Global

 internal Global(GlobalStatement stmt)
     : this() {
     _names = new PythonList(stmt.Names);
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:4,代码来源:_ast.cs

示例15: TryExcept

            internal TryExcept(TryStatement stmt)
                : this() {
                _body = ConvertStatements(stmt.Body);

                _handlers = PythonOps.MakeEmptyList(stmt.Handlers.Count);
                foreach (TryStatementHandler tryStmt in stmt.Handlers)
                    _handlers.Add(Convert(tryStmt));

                _orelse = ConvertStatements(stmt.Else, true);
            }
开发者ID:rchandrashekara,项目名称:main,代码行数:10,代码来源:_ast.cs


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