Package org.python.indexer.ast

Examples of org.python.indexer.ast.NName


    // resolved (since deserialization won't call the constructor).
    public void testConstructedTypes() throws Exception {
        assertNoneType(new NAlias(null, null, null));
        assertNoneType(new NAssert(null, null));
        assertNoneType(new NAssign(null, null));
        assertNoneType(new NAttribute(new NStr(), new NName("")));
        assertNoneType(new NAugAssign(null, null, null));
        assertNoneType(new NBinOp(null, null, null));
        assertNoneType(new NBlock(null));
        assertNoneType(new NBody((List<NNode>)null));
        assertNoneType(new NBoolOp(null, null));
        assertNoneType(new NBreak());
        assertNoneType(new NCall(null, null, null, null, null));
        assertNoneType(new NClassDef(null, null, null));
        assertNoneType(new NCompare(null, null, null));
        assertNoneType(new NComprehension(null, null, null));
        assertNoneType(new NContinue());
        assertNoneType(new NDelete(null));
        assertNoneType(new NDict(null, null));
        assertNoneType(new NEllipsis());
        assertNoneType(new NExceptHandler(null, null, null));
        assertNoneType(new NExec(null, null, null));
        assertNoneType(new NExprStmt(null));
        assertNoneType(new NFor(null, null, null, null));
        assertNoneType(new NFunctionDef(null, null, null, null, null, null));
        assertNoneType(new NGeneratorExp(null, null));
        assertNoneType(new NGlobal(null));
        assertNoneType(new NIf(null, null, null));
        assertNoneType(new NIfExp(null, null, null));
        assertNoneType(new NImport(null));
        assertNoneType(new NImportFrom(null, null, null));
        assertNoneType(new NIndex(null));
        assertNoneType(new NKeyword(null, null));
        assertNoneType(new NLambda(null, null, null, null, null));
        assertNoneType(new NList(null));
        assertNoneType(new NListComp(null, null));
        assertNoneType(new NModule(null, 0, 1));
        assertNoneType(new NName(""));
        assertNoneType(new NNum(-1));
        assertNoneType(new NPass());
        assertNoneType(new NPlaceHolder());
        assertNoneType(new NPrint(null, null));
        assertNoneType(new NQname(null, new NName("")));
        assertNoneType(new NRaise(null, null, null));
        assertNoneType(new NRepr(null));
        assertNoneType(new NReturn(null));
        assertNoneType(new NSlice(null, null, null));
        assertNoneType(new NStr());
View Full Code Here


        List<NNode> decos = f.getDecoratorList();
        assertNotNull(decos);
        assertEquals(2, decos.size());
        assertTrue(decos.get(0) instanceof NName);

        NName d1 = (NName)decos.get(0);
        assertEquals(nthIndexOf(src, "deco1", 1), d1.start());
        assertEquals("deco1".length(), d1.length());
        assertEquals("deco1", d1.id);

        assertTrue(decos.get(1) instanceof NCall);
        NCall d2 = (NCall)decos.get(1);
        assertTrue(d2.func instanceof NName);
View Full Code Here

        }
        file = node.getFile();
        start = node.start();

        if (node instanceof NName) {
            NName nn = ((NName)node);
            name = nn.id;
            if (nn.isCall()) {
                // We don't always have enough information at this point to know
                // if it's a constructor call or a regular function/method call,
                // so we just determine if it looks like a call or not, and the
                // indexer will convert constructor-calls to NEW in a later pass.
                markAsCall();
View Full Code Here

    private List<NName> convertListName(List<Name> in) throws Exception {
        List<NName> out = new ArrayList<NName>(in == null ? 0 : in.size());
        if (in != null) {
            for (expr e : in) {
                @SuppressWarnings("unchecked")
                NName nn = (NName)e.accept(this);
                if (nn != null) {
                    out.add(nn);
                }
            }
View Full Code Here

        for (int i = in.size() - 1; i >= 0; i--) {
            Name n = in.get(i);
            if (end == -1) {
                end = n.getCharStopIndex();
            }
            @SuppressWarnings("unchecked")
            NName nn = (NName)n.accept(this);
            out = new NQname(out, nn, n.getCharStartIndex(), end);
        }
        return out;
    }
View Full Code Here

        return new NModule(convertListStmt(n.getInternalBody()), start(n), stop(n));
    }

    @Override
    public Object visitName(Name n) throws Exception {
        return new NName(n.getInternalId(), start(n), stop(n));
    }
View Full Code Here

TOP

Related Classes of org.python.indexer.ast.NName

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.