Method | Description | |
---|---|---|
Reduce ( ) : |
WithStatement is translated to the DLR AST equivalent to the following Python code snippet (from with statement spec): mgr = (EXPR) exit = mgr.__exit__ # Not calling it yet value = mgr.__enter__() exc = True try: VAR = value # Only if "as VAR" is present BLOCK except: # The exceptional case is handled here exc = False if not exit(*sys.exc_info()): raise # The exception is swallowed if exit() returns true finally: # The normal and non-local-goto cases are handled here if exc: exit(None, None, None)
|
|
Walk ( IronPython.Compiler.Ast.PythonWalker walker ) : void | ||
WithStatement ( Expression contextManager, Expression var, Statement body ) : System |
Method | Description | |
---|---|---|
MakeExitCall ( System.Linq.Expressions exit, System.Linq.Expressions exception ) : |
public Walk ( IronPython.Compiler.Ast.PythonWalker walker ) : void | ||
walker | IronPython.Compiler.Ast.PythonWalker | |
return | void |
public WithStatement ( Expression contextManager, Expression var, Statement body ) : System | ||
contextManager | Expression | |
var | Expression | |
body | Statement | |
return | System |