aboutsummaryrefslogtreecommitdiff
path: root/interpreter
diff options
context:
space:
mode:
authorDrahflow <drahflow@gmx.de>2013-01-07 15:07:33 +0100
committerDrahflow <drahflow@gmx.de>2013-01-07 15:07:33 +0100
commite816e6bbbfe03b0ab15344155250ced004a7f924 (patch)
tree74aff268dd0ec215b2a5ce2968e28437408c02f0 /interpreter
parent80a0a5eefedf123ae25966396283e35305c93440 (diff)
Correctly handle unquoted scope capture
Diffstat (limited to 'interpreter')
-rw-r--r--interpreter/ElymasGlobal.pm10
1 files changed, 6 insertions, 4 deletions
diff --git a/interpreter/ElymasGlobal.pm b/interpreter/ElymasGlobal.pm
index 9cb0337..fddf483 100644
--- a/interpreter/ElymasGlobal.pm
+++ b/interpreter/ElymasGlobal.pm
@@ -37,7 +37,8 @@ our $global = {
push @$data, ['{', 'tok', '{'];
}, ['func', '{'], 'quote'],
'}' => [sub {
- my ($data, $scope) = @_;
+ my ($data, $refScope) = @_;
+ my $scope = $$refScope;
--$quoted;
@@ -61,13 +62,14 @@ our $global = {
} else {
push @$data, [sub {
my ($data) = @_;
- my $lscope = \{ ' parent' => $$scope };
+ my $lscope = \{ ' parent' => $scope };
interpretCode(\@code, $data, $lscope);
}, ['func', 'Dumper(\@code)']];
}
}, ['func', '}'], 'quote'],
"}'" => [sub {
- my ($data, $scope) = @_;
+ my ($data, $refScope) = @_;
+ my $scope = $$refScope;
--$quoted;
@@ -90,7 +92,7 @@ our $global = {
} else {
push @$data, [sub {
my ($data) = @_;
- interpretCode(\@code, $data, $scope);
+ interpretCode(\@code, $data, \$scope);
}, ['func', 'Dumper(\@code)']];
}
}, ['func', '}'], 'quote'],