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

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


        assertEquals(1, m.body.length);
        ClassDef classDef = ((ClassDef) m.body[0]);
        assertEquals("Bar", ((NameTok) classDef.name).id);
        assertEquals(1, classDef.body.length); //method

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


                "    def m1(self):pass");
        assertEquals(1, m.body.length);
        ClassDef classDef = (ClassDef) m.body[0];
        assertEquals("Bar", ((NameTok) classDef.name).id);

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

        assertEquals(2, m.body.length);
        ClassDef classDef = (ClassDef) m.body[0];

        assertEquals("Bar", ((NameTok) classDef.name).id);

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

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

        ClassDef classDefBar = (ClassDef) m.body[0];
        assertEquals(1, classDefBar.beginColumn);
        assertEquals(1, classDefBar.beginLine);

        assertEquals("Bar", ((NameTok) classDefBar.name).id);
        FunctionDef defGlobal = (FunctionDef) m.body[1];
        assertEquals("mGlobal", ((NameTok) (defGlobal).name).id);
        assertEquals(1, defGlobal.beginColumn);
        assertEquals(7, defGlobal.beginLine);

        ClassDef classDefZoo = (ClassDef) classDefBar.body[0];
        assertEquals("Zoo", ((NameTok) classDefZoo.name).id);
        assertEquals(5, classDefZoo.beginColumn);
        assertEquals(2, classDefZoo.beginLine);

        assertEquals(2, classDefZoo.body.length);
        FunctionDef defM1 = (FunctionDef) classDefZoo.body[0];
        assertEquals("m1", ((NameTok) (defM1).name).id);
        assertEquals(9, defM1.beginColumn);
        assertEquals(3, defM1.beginLine);

    }
View Full Code Here

                "    #d\n" +
                "    'string'\n"
                +
                "def mGlobal(self):pass\n");

        FunctionDef defGlobal = (FunctionDef) m.body[1];
        assertEquals("mGlobal", ((NameTok) (defGlobal).name).id);
        assertEquals(1, defGlobal.beginColumn);
        assertEquals(4, defGlobal.beginLine);

    }
View Full Code Here

        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];
        assertEquals("ra", ((NameTok) (defRa).name).id);
        assertEquals(5, defRa.beginColumn);
        assertEquals(2, defRa.beginLine);

        FunctionDef defM2 = (FunctionDef) classDefBar.body[1];
        assertEquals("m2", ((NameTok) (defM2).name).id);
        assertEquals(5, defM2.beginColumn);
        assertEquals(6, defM2.beginLine);

    }
View Full Code Here

        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];
        assertEquals("ra", ((NameTok) (defRa).name).id);
        assertEquals(5, defRa.beginColumn);
        assertEquals(2, defRa.beginLine);

        FunctionDef defM2 = (FunctionDef) classDefBar.body[1];
        assertEquals("m2", ((NameTok) (defM2).name).id);
        assertEquals(5, defM2.beginColumn);
        assertEquals(11, defM2.beginLine);
    }
View Full Code Here

        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];
        assertEquals("ra", ((NameTok) (defRa).name).id);
        assertEquals(5, defRa.beginColumn);
        assertEquals(2, defRa.beginLine);

        //2 assigns
        FunctionDef defM2 = (FunctionDef) classDefBar.body[4];
        assertEquals("m2", ((NameTok) (defM2).name).id);
        assertEquals(5, defM2.beginColumn);
        assertEquals(14, defM2.beginLine);
    }
View Full Code Here

        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];
        assertEquals("m2", ((NameTok) (defM2).name).id);
        assertEquals(5, defM2.beginColumn);
        assertEquals(9, defM2.beginLine);
    }
View Full Code Here

        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];
        assertEquals("m2", ((NameTok) (defM2).name).id);
        assertEquals(5, defM2.beginColumn);
        assertEquals(2, defM2.beginLine);

        Assign a = (Assign) defM2.body[0];
View Full Code Here

TOP

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

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.