C# Class Phantom.Core.Builtins.WithMacro

The 'with' macro can be used to turn this: with Foo(): .bar() .baz() ...into this: var foo = new Foo(); foo.bar(); foo.baz(); ...it also works with alternative syntaxes: with f = Foo(): .bar() .baz() ... this means you can continue to access the 'f' variable after the with block has completed. f = Foo() with f: .bar() .baz() This would be much simpler if I wrote the macro in Boo rather than C#, but I thought this would be fun...
Inheritance: Boo.Lang.Compiler.AbstractAstMacro
Exibir arquivo Open project: JeremySkinner/Phantom

Public Methods

Method Description
Expand ( MacroStatement macro ) : Statement

Private Methods

Method Description
AddRunExpressionToBody ( Block block, Expression temporaryVariable ) : void
ConvertExpressionToTemporaryVariable ( Expression methodInvocation, Block block ) : Expression

Method Details

Expand() public method

public Expand ( MacroStatement macro ) : Statement
macro Boo.Lang.Compiler.Ast.MacroStatement
return Boo.Lang.Compiler.Ast.Statement