Package org.python.pydev.parser.jython.ast

Examples of org.python.pydev.parser.jython.ast.Module


        Assign assign = ((Assign) m.body[0]);
        assertEquals("GLOBAL_ATTRIBUTE", ((Name) assign.targets[0]).id);
    }

    public void testGlobalAttributes5() {
        Module m = (Module) FastDefinitionsParser.parse("GLOBAL_ATTRIBUTE = 10\n" +
                "GLOBAL_ATTRIBUTE2 = 10\n" +
                "\n"
                +
                "");
        assertEquals(2, m.body.length);
View Full Code Here


    public void testGlobalAttributes4() {
        String str = "class A:\n" +
                "    pass\n" +
                "GLOBAL_ATTR = 10\n" +
                "";
        Module m = (Module) FastDefinitionsParser.parse(str);
        assertEquals(2, m.body.length);
        Assign assign = ((Assign) m.body[1]);
        assertEquals("GLOBAL_ATTR", ((Name) assign.targets[0]).id);
    }
View Full Code Here

                "IGNORE = 'IGNORE'\n" +
                "SKIP   = 'SKIP'\n"
                +
                "\n" +
                "";
        Module m = (Module) FastDefinitionsParser.parse(str);
        assertEquals(3, m.body.length);
        Assign assign = ((Assign) m.body[1]);
        assertEquals("IGNORE", ((Name) assign.targets[0]).id);
    }
View Full Code Here

                "\n" +
                "\n" +
                "\n" +
                "\n" +
                "";
        Module m = (Module) FastDefinitionsParser.parse(str);
        System.out.println("OK");
    }
View Full Code Here

        Assign assign = ((Assign) m.body[0]);
        assertEquals("new_a", ((Name) assign.targets[0]).id);
    }

    public void testDefinitionsParser() {
        Module m = (Module) FastDefinitionsParser.parse("class Bar:pass");
        assertEquals(1, m.body.length);
        assertEquals("Bar", ((NameTok) ((ClassDef) m.body[0]).name).id);
    }
View Full Code Here

        assertEquals(1, m.body.length);
        assertEquals("Bar", ((NameTok) ((ClassDef) m.body[0]).name).id);
    }

    public void testDefinitionsAttributesParser() {
        Module m = (Module) FastDefinitionsParser.parse("class Bar:pass");
        assertEquals(1, m.body.length);
        assertEquals("Bar", ((NameTok) ((ClassDef) m.body[0]).name).id);
    }
View Full Code Here

        assertEquals(1, m.body.length);
        assertEquals("Bar", ((NameTok) ((ClassDef) m.body[0]).name).id);
    }

    public void testDefinitionsParser2() {
        Module m = (Module) FastDefinitionsParser.parse("class Bar");
        assertEquals(1, m.body.length);
        assertEquals("Bar", ((NameTok) ((ClassDef) m.body[0]).name).id);
    }
View Full Code Here

        assertEquals(1, m.body.length);
        assertEquals("Bar", ((NameTok) ((ClassDef) m.body[0]).name).id);
    }

    public void testDefinitionsParser3() {
        Module m = (Module) FastDefinitionsParser.parse("class Bar(object):pass");
        assertEquals(1, m.body.length);
        assertEquals("Bar", ((NameTok) ((ClassDef) m.body[0]).name).id);
    }
View Full Code Here

        assertEquals(1, m.body.length);
        assertEquals("Bar", ((NameTok) ((ClassDef) m.body[0]).name).id);
    }

    public void testDefinitionsParser4() {
        Module m = (Module) FastDefinitionsParser.parse("class Bar(object):\n" +
                "    def m1(self):pass");
        assertEquals(1, m.body.length);
        ClassDef classDef = (ClassDef) m.body[0];
        assertEquals("Bar", ((NameTok) classDef.name).id);
View Full Code Here

        FunctionDef funcDef = (FunctionDef) classDef.body[0];
        assertEquals("m1", ((NameTok) funcDef.name).id);
    }

    public void testDefinitionsParser5() {
        Module m = (Module) FastDefinitionsParser.parse("class Bar(object):\n" +
                "    def m1(self):pass\n"
                +
                "def m2(self):pass\n");
        assertEquals(2, m.body.length);
        ClassDef classDef = (ClassDef) m.body[0];
View Full Code Here

TOP

Related Classes of org.python.pydev.parser.jython.ast.Module

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.