Fixed: variable indices were incorrect in nested scopes.

This commit is contained in:
arookas 2015-12-12 12:40:37 -05:00
parent 84c4326c09
commit f506572894
4 changed files with 53 additions and 12 deletions

View file

@ -114,7 +114,7 @@ namespace arookas
public override void Compile(sunContext context)
{
context.Scopes.Push();
context.Scopes.Push(context.Scopes.Top.Type);
context.Loops.Push(IsNamed ? NameLabel.Label.Value : null);
TryCompile(Declaration, context);
var bodyPrologue = context.Text.OpenPoint();

View file

@ -10,7 +10,7 @@
public override void Compile(sunContext context)
{
context.Scopes.Push();
context.Scopes.Push(context.Scopes.Top.Type);
base.Compile(context);
context.Scopes.Pop();
}