Package org.python.indexer.types

Examples of org.python.indexer.types.NTupleType


        super(elts, start, end);
    }

    @Override
    public NType resolve(Scope s) throws Exception {
        NTupleType thisType = new NTupleType();
        for (NNode e : elts) {
            thisType.add(resolveExpr(e, s));
        }
        return setType(thisType);
    }
View Full Code Here


            } else if (!(args.get(0) instanceof NName)) {
                addError(name, "self parameter must be an identifier");
            }
        }

        NTupleType fromType = new NTupleType();
        bindParamsToDefaults(selfBinding, fromType);

        if (varargs != null) {
            NBinding b = funcTable.lookupLocal(varargs.id);
            if (b != null) {
                fromType.add(b.getType());
            }
        }

        if (kwargs != null) {
            NBinding b = funcTable.lookupLocal(kwargs.id);
            if (b != null) {
                fromType.add(b.getType());
            }
        }

        NType toType = resolveExpr(body, funcTable);
        getType().asFuncType().setReturnType(toType);
View Full Code Here

            }
            baseTypes.add(baseType);
        }

        Builtins builtins = Indexer.idx.builtins;
        addSpecialAttribute("__bases__", new NTupleType(baseTypes));
        addSpecialAttribute("__name__", builtins.BaseStr);
        addSpecialAttribute("__module__", builtins.BaseStr);
        addSpecialAttribute("__doc__", builtins.BaseStr);
        addSpecialAttribute("__dict__", new NDictType(builtins.BaseStr, new NUnknownType()));
View Full Code Here

        if (!getType().isFuncType()) {
            org.python.indexer.Indexer.idx.reportFailedAssertion(
                "Bad type on " + this + ": type=" + getType() +
                " in file " + getFile() + " at " + start());
        }
        NTupleType fromType = new NTupleType();
        NameBinder param = NameBinder.make(NBinding.Kind.PARAMETER);

        resolveList(defaults, s);

        Scope funcTable = getTable();
        int argnum = 0;
        for (NNode a : args) {
            NType argtype = NFunctionDef.getArgType(args, defaults, argnum++);
            param.bind(funcTable, a, argtype);
            fromType.add(argtype);
        }

        if (varargs != null) {
            NType u = new NUnknownType();
            param.bind(funcTable, varargs, u);
            fromType.add(u);
        }

        if (kwargs != null) {
            NType u = new NUnknownType();
            param.bind(funcTable, kwargs, u);
            fromType.add(u);
        }

        // A lambda body is not an NBody, so it doesn't undergo the two
        // pre-resolve passes for finding global statements and name-binding
        // constructs.  However, the lambda expression may itself contain
View Full Code Here

        nativeTypes.add(t);
        return t;
    }

    NTupleType newTuple(NType... types) {
        NTupleType t = new NTupleType(types);
        nativeTypes.add(t);
        return t;
    }
View Full Code Here

TOP

Related Classes of org.python.indexer.types.NTupleType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.