public void GetInnerMostBlockOrMethodScope(out RubyBlockScope blockScope, out RubyMethodScope methodScope) { methodScope = null; blockScope = null; RubyScope scope = this; while (scope != null) { switch (scope.Kind) { case ScopeKind.Block: case ScopeKind.BlockMethod: case ScopeKind.BlockModule: blockScope = (RubyBlockScope)scope; return; case ScopeKind.Method: methodScope = (RubyMethodScope)scope; return; } scope = scope.Parent; } }
public void GetInnerMostBlockOrMethodScope(out RubyBlockScope blockScope, out RubyMethodScope methodScope) { methodScope = null; blockScope = null; RubyScope scope = this; while (scope != null) { switch (scope.Kind) { case ScopeKind.Block: blockScope = (RubyBlockScope)scope; return; case ScopeKind.Method: methodScope = (RubyMethodScope)scope; return; } scope = scope.Parent; } }
public static void LeaveBlockFrame(RubyBlockScope/*!*/ scope) { }
public static void TraceBlockReturn(RubyBlockScope/*!*/ scope, BlockParam/*!*/ block, string fileName, int lineNumber) { if (block.IsMethod) { scope.RubyContext.ReportTraceEvent("return", scope, block.MethodLookupModule, block.MethodName, fileName, lineNumber); } }
public static RubyBlockScope/*!*/ CreateBlockScope(LocalsDictionary/*!*/ locals, RubyScope/*!*/ parent, BlockParam/*!*/ blockParam, object selfObject, InterpretedFrame interpretedFrame) { Assert.NotNull(locals, parent, blockParam); RubyBlockScope scope = new RubyBlockScope(parent, parent.RuntimeFlowControl, blockParam, selfObject); scope.MethodAttributes = RubyMethodAttributes.PublicInstance; scope.Frame = locals; scope.InterpretedFrame = interpretedFrame; return scope; }
public static void TraceBlockReturn(RubyBlockScope/*!*/ scope, BlockParam/*!*/ block, string fileName, int lineNumber) { if (block.ModuleDeclaration != null && block.SuperMethodName != null) { scope.RubyContext.ReportTraceEvent("return", scope, block.ModuleDeclaration, block.SuperMethodName, fileName, lineNumber); } }
public static RubyBlockScope/*!*/ CreateBlockScope(LocalsDictionary/*!*/ locals, RubyScope/*!*/ parent, BlockParam/*!*/ blockParam, object selfObject) { Assert.NotNull(locals, parent, blockParam); RubyBlockScope scope = new RubyBlockScope(parent, locals); // TODO: used to inherit parent.MethodAttributes scope.Initialize(parent.RuntimeFlowControl, RubyMethodAttributes.PublicInstance, selfObject); scope.BlockParameter = blockParam; return scope; }