ToplevelBlock toplevel = block.Toplevel;
AnonymousContainer ac = toplevel.AnonymousContainer;
- Report.Debug (128, "CREATE SCOPE", block, toplevel, ac);
+ Report.Debug (128, "CREATE SCOPE", block, block.ScopeInfo, toplevel, ac);
if (ac == null)
return new ScopeInfo (block, toplevel.RootScope.Parent);
}
}
- Report.Debug (128, "CREATRE SCOPE #1", parent);
+ Report.Debug (128, "CREATE SCOPE #2", parent);
- return new ScopeInfo (block, parent);
+ ScopeInfo new_scope = new ScopeInfo (block, parent);
+
+ Report.Debug (128, "CREATE SCOPE #3", new_scope);
+ // Report.StackTrace ();
+
+ return new_scope;
}
protected ScopeInfo (Block block, TypeContainer parent)
RootScope = block.Toplevel.RootScope;
ScopeBlock = block;
- Report.Debug (128, "NEW SCOPE", this, block);
+ Report.Debug (128, "NEW SCOPE", this, block,
+ block.Parent, block.Toplevel);
RootScope.AddScope (this);
}
RootScope = (RootScopeInfo) this;
ScopeBlock = toplevel;
- Report.Debug (128, "NEW ROOT SCOPE", this);
+ Report.Debug (128, "NEW ROOT SCOPE", this, toplevel, loc);
}
protected ScopeInfo host_scope;
public Variable AddLocal (LocalInfo local)
{
+ Report.Debug (128, "CAPTURE LOCAL", this, local);
Variable var = (Variable) locals [local];
if (var == null) {
var = new CapturedLocal (this, local);
protected virtual void DoEmitStatement (EmitContext ec)
{
- Report.Debug (64, "EMIT SCOPE INIT", this, id,
+ Report.Debug (128, "EMIT SCOPE INITIALIZER STATEMENT", this, id,
Scope, scope_instance, ec);
+ // Report.StackTrace ();
ec.ig.Emit (OpCodes.Nop);
ec.ig.Emit (OpCodes.Ldc_I4, id);
Block b;
scope = RootScope;
- for (b = Block; b != null; b = b.Parent) {
+ Report.Debug (128, "CREATE METHOD HOST #1", this, Block, Block.ScopeInfo,
+ RootScope, Location);
+
+ for (b = Block.Parent; b != null; b = b.Parent) {
+ Report.Debug (128, "CREATE METHOD HOST #2", this, Block,
+ b, b.ScopeInfo);
if (b.ScopeInfo != null) {
scope = b.ScopeInfo;
break;
if (!VerifyAssigned (ec))
return null;
+ Report.Debug (128, "RESOLVE LOCAL INFO", this, Name, loc, local_info,
+ ec.MustCaptureVariable (local_info));
+
//
// If we are referencing a variable from the external block
// flag it for capturing
ScopeInfo scope = local_info.Block.CreateScopeInfo ();
variable = scope.AddLocal (local_info);
type = variable.Type;
+
+ Report.Debug (128, "RESOLVE LOCAL INFO #1", this, Name, loc, local_info,
+ ec.MustCaptureVariable (local_info), scope, variable);
+
}
return this;
//
public virtual void EmitMeta (EmitContext ec)
{
- Report.Debug (64, "BLOCK EMIT META", this, Toplevel, ScopeInfo, ec);
+ Report.Debug (64, "BLOCK EMIT META", this, Parent, Toplevel, ScopeInfo, ec);
if (ScopeInfo != null) {
scope_init = ScopeInfo.GetScopeInitializer (ec);
Report.Debug (64, "BLOCK EMIT META #1", this, Toplevel, ScopeInfo,