Added test for scopes

This commit is contained in:
Mattia Giambirtone 2022-07-09 13:37:16 +02:00
parent 3f5f514259
commit f32a45c8d8
8 changed files with 29 additions and 0 deletions

BIN
tests/calls.pbc Normal file

Binary file not shown.

BIN
tests/closures.pbc Normal file

Binary file not shown.

BIN
tests/dispatch.pbc Normal file

Binary file not shown.

BIN
tests/generics.pbc Normal file

Binary file not shown.

BIN
tests/scopes.pbc Normal file

Binary file not shown.

10
tests/scopes.pn Normal file
View File

@ -0,0 +1,10 @@
var x = 5;
{
var x = 55;
{
var x = 22;
x;
}
x;
}
x;

BIN
tests/test.pbc Normal file

Binary file not shown.

19
tests/test.pn Normal file
View File

@ -0,0 +1,19 @@
operator `+`(a, b: int): int {
#pragma[magic: "AddInt64", pure]
}
fn getAdder(a, b: int): fn: int64 {
var x = a;
var y = b;
fn adder: int {
return x + y;
}
return adder;
}
var a = 5;
var b = 6;
var adder = getAdder(a, b);
adder();