mirror of
https://github.com/MorizzG/MLox.git
synced 2025-12-06 04:22:41 +00:00
added closures
This commit is contained in:
parent
34c279ec2e
commit
b425a59db5
5 changed files with 59 additions and 28 deletions
63
lox.t/run.t
63
lox.t/run.t
|
|
@ -205,19 +205,28 @@ $ mlox class/reference_self.lox
|
|||
|
||||
|
||||
file closure/assign_to_closure.lox
|
||||
$ mlox closure/assign_to_closure.lox
|
||||
$ mlox closure/assign_to_closure.lox
|
||||
local
|
||||
after f
|
||||
after f
|
||||
after g
|
||||
|
||||
|
||||
file closure/assign_to_shadowed_later.lox
|
||||
$ mlox closure/assign_to_shadowed_later.lox
|
||||
inner
|
||||
assigned
|
||||
|
||||
|
||||
file closure/close_over_function_parameter.lox
|
||||
$ mlox closure/close_over_function_parameter.lox
|
||||
$ mlox closure/close_over_function_parameter.lox
|
||||
param
|
||||
|
||||
|
||||
file closure/close_over_later_variable.lox
|
||||
$ mlox closure/close_over_later_variable.lox
|
||||
$ mlox closure/close_over_later_variable.lox
|
||||
b
|
||||
a
|
||||
|
||||
|
||||
file closure/close_over_method_parameter.lox
|
||||
|
|
@ -225,35 +234,48 @@ $ mlox closure/close_over_method_parameter.lox
|
|||
|
||||
|
||||
file closure/closed_closure_in_function.lox
|
||||
$ mlox closure/closed_closure_in_function.lox
|
||||
$ mlox closure/closed_closure_in_function.lox
|
||||
local
|
||||
|
||||
|
||||
file closure/nested_closure.lox
|
||||
$ mlox closure/nested_closure.lox
|
||||
$ mlox closure/nested_closure.lox
|
||||
a
|
||||
b
|
||||
c
|
||||
|
||||
|
||||
file closure/open_closure_in_function.lox
|
||||
$ mlox closure/open_closure_in_function.lox
|
||||
$ mlox closure/open_closure_in_function.lox
|
||||
local
|
||||
|
||||
|
||||
file closure/reference_closure_multiple_times.lox
|
||||
$ mlox closure/reference_closure_multiple_times.lox
|
||||
$ mlox closure/reference_closure_multiple_times.lox
|
||||
a
|
||||
a
|
||||
|
||||
|
||||
file closure/reuse_closure_slot.lox
|
||||
$ mlox closure/reuse_closure_slot.lox
|
||||
$ mlox closure/reuse_closure_slot.lox
|
||||
a
|
||||
|
||||
|
||||
file closure/shadow_closure_with_local.lox
|
||||
$ mlox closure/shadow_closure_with_local.lox
|
||||
$ mlox closure/shadow_closure_with_local.lox
|
||||
closure
|
||||
shadow
|
||||
closure
|
||||
|
||||
|
||||
file closure/unused_closure.lox
|
||||
$ mlox closure/unused_closure.lox
|
||||
$ mlox closure/unused_closure.lox
|
||||
ok
|
||||
|
||||
|
||||
file closure/unused_later_closure.lox
|
||||
$ mlox closure/unused_later_closure.lox
|
||||
$ mlox closure/unused_later_closure.lox
|
||||
a
|
||||
|
||||
|
||||
file comments/line_at_eof.lox
|
||||
|
|
@ -532,9 +554,9 @@ file function/extra_arguments.lox
|
|||
|
||||
|
||||
file function/local_mutual_recursion.lox
|
||||
$ mlox function/local_mutual_recursion.lox
|
||||
RuntimeError at line 4, column 11: name "isOdd" is not defined
|
||||
[1]
|
||||
$ mlox function/local_mutual_recursion.lox
|
||||
RuntimeError at line 4, column 11: name "isOdd" is not defined
|
||||
[1]
|
||||
|
||||
file function/local_recursion.lox
|
||||
$ mlox function/local_recursion.lox
|
||||
|
|
@ -1079,7 +1101,8 @@ file print/missing_argument.lox
|
|||
|
||||
|
||||
file regression/40.lox
|
||||
$ mlox regression/40.lox
|
||||
$ mlox regression/40.lox
|
||||
false
|
||||
|
||||
|
||||
file regression/394.lox
|
||||
|
|
@ -1268,6 +1291,8 @@ file variable/duplicate_parameter.lox
|
|||
|
||||
file variable/early_bound.lox
|
||||
$ mlox variable/early_bound.lox
|
||||
outer
|
||||
outer
|
||||
|
||||
|
||||
file variable/in_middle_of_block.lox
|
||||
|
|
@ -1379,7 +1404,10 @@ $ mlox while/class_in_body.lox
|
|||
|
||||
|
||||
file while/closure_in_body.lox
|
||||
$ mlox while/closure_in_body.lox
|
||||
$ mlox while/closure_in_body.lox
|
||||
1
|
||||
2
|
||||
3
|
||||
|
||||
|
||||
file while/fun_in_body.lox
|
||||
|
|
@ -1390,7 +1418,8 @@ file while/fun_in_body.lox
|
|||
|
||||
|
||||
file while/return_closure.lox
|
||||
$ mlox while/return_closure.lox
|
||||
$ mlox while/return_closure.lox
|
||||
i
|
||||
|
||||
|
||||
file while/return_inside.lox
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue