Implemented scopes

This commit is contained in:
2024-10-27 13:44:09 +11:00
parent d22b18ed17
commit c5206daaea
10 changed files with 90 additions and 9 deletions

View File

@@ -0,0 +1,19 @@
//shadowing
var answer = 42;
print answer; //42
{
var answer = 7;
print answer; //7
}
print answer; //42
//rebinding
var question = 42;
print question; //42
{
var question = question;
print question; //42
}
print question; //42
//TODO: scope test case