Fixed: variable indices were incorrect in nested scopes.
This commit is contained in:
parent
84c4326c09
commit
f506572894
4 changed files with 53 additions and 12 deletions
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue