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

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


                "    )\n" +
                "    def m2(self):pass\n" +
                "        #def m3(self):pass\n" +
                "        'string'\n");
        assertEquals(1, m.body.length);
        ClassDef classDefBar = (ClassDef) m.body[0];
        assertEquals(1, classDefBar.beginColumn);
        assertEquals(1, classDefBar.beginLine);
        assertEquals("Bar", ((NameTok) classDefBar.name).id);

        FunctionDef defRa = (FunctionDef) classDefBar.body[0];
View Full Code Here


                +
                "    def m2(self):pass\n" +
                "        #def m3(self):pass\n" +
                "        'string'\n");
        assertEquals(1, m.body.length);
        ClassDef classDefBar = (ClassDef) m.body[0];
        assertEquals(1, classDefBar.beginColumn);
        assertEquals(1, classDefBar.beginLine);
        assertEquals("Bar", ((NameTok) classDefBar.name).id);

        FunctionDef defRa = (FunctionDef) classDefBar.body[0];
View Full Code Here

                "    def m2(self):pass\n" +
                "        #def m3(self):pass\n"
                +
                "        'string'\n");
        assertEquals(1, m.body.length);
        ClassDef classDefBar = (ClassDef) m.body[0];
        assertEquals(1, classDefBar.beginColumn);
        assertEquals(1, classDefBar.beginLine);
        assertEquals("Bar", ((NameTok) classDefBar.name).id);

        FunctionDef defRa = (FunctionDef) classDefBar.body[0];
View Full Code Here

                "    def m2(self):pass\n"
                +
                "        #def m3(self):pass\n" +
                "        'string'\n");
        assertEquals(1, m.body.length);
        ClassDef classDefBar = (ClassDef) m.body[0];
        assertEquals(1, classDefBar.beginColumn);
        assertEquals(1, classDefBar.beginLine);
        assertEquals("Bar", ((NameTok) classDefBar.name).id);

        FunctionDef defM2 = (FunctionDef) classDefBar.body[2];
View Full Code Here

    public void testDefinitionsParserLines5() {
        Module m = (Module) FastDefinitionsParser.parse("class Bar(object):\n" +
                "    def m2(self):self.a=10\n");
        assertEquals(1, m.body.length);
        ClassDef classDefBar = (ClassDef) m.body[0];
        assertEquals(1, classDefBar.beginColumn);
        assertEquals(1, classDefBar.beginLine);
        assertEquals("Bar", ((NameTok) classDefBar.name).id);

        FunctionDef defM2 = (FunctionDef) classDefBar.body[0];
View Full Code Here

                "    def m2(\n" +
                "        self,\n"
                +
                "        a):self.a=10\n");
        assertEquals(1, m.body.length);
        ClassDef classDefBar = (ClassDef) m.body[0];
        assertEquals(1, classDefBar.beginColumn);
        assertEquals(1, classDefBar.beginLine);
        assertEquals("Bar", ((NameTok) classDefBar.name).id);

        FunctionDef defM2 = (FunctionDef) classDefBar.body[0];
View Full Code Here

                "    def m2 ( \n" +
                "        self,\n"
                +
                "        a ) : self.a=10\n");
        assertEquals(1, m.body.length);
        ClassDef classDefBar = (ClassDef) m.body[0];
        assertEquals(1, classDefBar.beginColumn);
        assertEquals(1, classDefBar.beginLine);
        assertEquals("Bar", ((NameTok) classDefBar.name).id);

        FunctionDef defM2 = (FunctionDef) classDefBar.body[0];
View Full Code Here

                "            mock.uninstall()\r\n" +
                "\r\n" +
                "        self.assertEqual(c.Method(5), 10)\r\n" +
                "");
        assertEquals(1, m.body.length);
        ClassDef classDef = (ClassDef) m.body[0];
        assertEquals(1, classDef.beginColumn);
        assertEquals(5, classDef.beginLine);
        assertEquals("Test", ((NameTok) classDef.name).id);

        FunctionDef def = (FunctionDef) classDef.body[0];
View Full Code Here

        assertEquals(3, m.body.length);
        FunctionDef d = (FunctionDef) m.body[0];
        assertEquals("method", NodeUtils.getRepresentationString(d.name));
        assertNull(d.body);

        ClassDef cd = (ClassDef) m.body[1];
        assertEquals("F", NodeUtils.getRepresentationString(cd.name));
        assertEquals(1, cd.body.length);

        d = (FunctionDef) m.body[2];
        assertEquals("another", NodeUtils.getRepresentationString(d.name));
View Full Code Here

                        "class Class1:         \n" +
                        "    def met1(self, a):\n" +
                        "        pass";
                SimpleNode node = parseLegalDocStr(s);
                Module m = (Module) node;
                ClassDef d = (ClassDef) m.body[0];
                FunctionDef f = (FunctionDef) d.body[0];
                assertEquals("self", ((Name) f.args.args[0]).id);
                assertEquals("a", ((Name) f.args.args[1]).id);
                return true;
            }
View Full Code Here

TOP

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

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.