C# Class IronPython.Compiler.Ast.WithStatement

Inheritance: Statement
Afficher le fichier Open project: jschementi/iron Class Usage Examples

Méthodes publiques

Méthode Description
Reduce ( ) : Expression

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

Private Methods

Méthode Description
MakeExitCall ( System.Linq.Expressions exit, System.Linq.Expressions exception ) : Expression

Method Details

Reduce() public méthode

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)
public Reduce ( ) : Expression
Résultat System.Linq.Expressions.Expression

Walk() public méthode

public Walk ( IronPython.Compiler.Ast.PythonWalker walker ) : void
walker IronPython.Compiler.Ast.PythonWalker
Résultat void

WithStatement() public méthode

public WithStatement ( Expression contextManager, Expression var, Statement body ) : System
contextManager Expression
var Expression
body Statement
Résultat System