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

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


        }

        suiteType s = new Suite(suite.body);
        addSpecialsAndClearOriginal(suite, s);

        return new With(items, s);
    }
View Full Code Here


                }

                suiteType s = new Suite(suite.body);
                addSpecialsAndClearOriginal(suite, s);

                return new With(new WithItem[] { new WithItem(expr, asOrExpr) }, s);
            case JJTWITH_VAR:
                expr = (exprType) stack.popNode(); //expr
                if (expr != null) {
                    ctx.setStore(expr);
                }
View Full Code Here

        if (node instanceof While) {
            While module = (While) node;
            return module.body;
        }
        if (node instanceof With) {
            With module = (With) node;
            return module.body.body;
        }
        return new stmtType[0];
    }
View Full Code Here

                }

                suiteType s = new Suite(suite.body);
                addSpecialsAndClearOriginal(suite, s);

                return new With(new WithItem[] { new WithItem(expr, asOrExpr) }, s);
            case JJTWITH_VAR:
                expr = (exprType) stack.popNode(); //expr
                if (expr != null) {
                    ctx.setStore(expr);
                }
View Full Code Here

                "";
        //we'll actually treat this as a try..finally with a body with try..except..else
        Module mod = (Module) parseLegalDocStr(str);
        assertEquals(2, mod.body.length);
        assertTrue(mod.body[1] instanceof With);
        With w = (With) mod.body[1];
        assertTrue(((WithItem) w.with_item[0]).optional_vars == null);

    }
View Full Code Here

                "";
        //we'll actually treat this as a try..finally with a body with try..except..else
        Module mod = (Module) parseLegalDocStr(str);
        assertEquals(2, mod.body.length);
        assertTrue(mod.body[1] instanceof With);
        With w = (With) mod.body[1];
        assertTrue(((WithItem) w.with_item[0]).optional_vars != null);

    }
View Full Code Here

                "";
        //we'll actually treat this as a try..finally with a body with try..except..else
        Module mod = (Module) parseLegalDocStr(str);
        assertEquals(2, mod.body.length);
        assertTrue(mod.body[1] instanceof With);
        With w = (With) mod.body[1];
        assertTrue(((WithItem) w.with_item[0]).optional_vars != null);

    }
View Full Code Here

                "    print 'bla'\n" +
                "";
        Module mod = (Module) parseLegalDocStr(str);
        assertEquals(2, mod.body.length);
        assertTrue(mod.body[1] instanceof With);
        With w = (With) mod.body[1];
        assertTrue(((WithItem) w.with_item[0]).optional_vars != null);

    }
View Full Code Here

TOP

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

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.