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

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


        funcDef = (FunctionDef) m.body[1];
        assertEquals("m2", ((NameTok) funcDef.name).id);
    }

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


        assertEquals("m2", ((NameTok) ((FunctionDef) m.body[1]).name).id);
    }

    public void testDefinitionsParser7() {
        Module m = (Module) FastDefinitionsParser.parse(
                "class Bar(object):\n" +
                        "    class Zoo(object):\n" +
                        "        class PPP(self):pass\n" +

                        "class Bar2(object):\n" +
View Full Code Here

        assertEquals("Zoo2", ((NameTok) classDefZoo.name).id);
        assertEquals("PPP2", ((NameTok) ((ClassDef) classDefZoo.body[0]).name).id);
    }

    public void testDefinitionsParser7a() {
        Module m = (Module) FastDefinitionsParser.parse(
                "class Bar(object):\n" +
                        "    class Zoo(object):\n" +
                        "        pass\n" +

                        "class Bar2(object):\n" +
View Full Code Here

        classDefZoo = (ClassDef) classDefBar.body[0];
        assertEquals("Zoo2", ((NameTok) classDefZoo.name).id);
    }

    public void testDefinitionsParser7b() {
        Module m = (Module) FastDefinitionsParser.parse(
                "class Bar(object):\n" +
                        "    pass\n" +
                        "class Bar2(object):\n" +
                        "    pass\n");
        assertEquals(2, m.body.length);
View Full Code Here

        classDefBar = (ClassDef) m.body[1];
        assertEquals("Bar2", ((NameTok) classDefBar.name).id);
    }

    public void testDefinitionsParser8() {
        Module m = (Module) FastDefinitionsParser.parse("class Bar(object):\n" +
                "    class Zoo(object):\n"
                +
                "        def m1(self):pass\n" +
                "        def m2(self):pass\n" +
                "            def m3(self):pass\n"
View Full Code Here

        assertEquals("m1", ((NameTok) ((FunctionDef) classDefZoo.body[0]).name).id);

    }

    public void testDefinitionsParser9() {
        Module m = (Module) FastDefinitionsParser.parse("class Bar(object):\n" +
                "    class \tZoo\t(object):\n"
                +
                "        def     m1(self):pass\n" +
                "        def m2(self):pass\n" +
                "            def m3(self):pass\n"
View Full Code Here

        assertEquals("m1", ((NameTok) ((FunctionDef) classDefZoo.body[0]).name).id);

    }

    public void testDefinitionsParser11() {
        Module m = (Module) FastDefinitionsParser.parse("class Bar(object):\n" +
                "    class \tZoo\t(object):\n"
                +
                "        def     m1(self):pass\n" +
                "        def m2(self):pass\n"
                +
View Full Code Here

        assertEquals(3, defM1.beginLine);

    }

    public void testDefinitionsParser12() {
        Module m = (Module) FastDefinitionsParser.parse("class Bar(object):\n" +
                "    #d\n" +
                "    'string'\n"
                +
                "def mGlobal(self):pass\n");
View Full Code Here

        assertEquals(4, defGlobal.beginLine);

    }

    public void testDefinitionsParserLines() {
        Module m = (Module) FastDefinitionsParser.parse("class Bar(object):\n" +
                "    def ra(\n" +
                "\n" +
                "\n"
                +
                "    )\n" +
View Full Code Here

        assertEquals(6, defM2.beginLine);

    }

    public void testDefinitionsParserLines2() {
        Module m = (Module) FastDefinitionsParser.parse("class Bar(object):\n" +
                "    def ra(\n" +
                "\n" +
                "\n"
                +
                "    )\n" +
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.