I added some more backpatching and some more files for testing
This commit is contained in:
@ -44,13 +44,13 @@ b(x) := {
|
||||
i := x;
|
||||
return a;
|
||||
}
|
||||
|
||||
|
||||
c(x) := {
|
||||
[string: s]
|
||||
s := "Hi!";
|
||||
return x(s);
|
||||
}
|
||||
|
||||
|
||||
|
||||
(* Function definition
|
||||
entry is the first function called
|
||||
@ -65,7 +65,7 @@ entry(arg) := {
|
||||
result := 0;
|
||||
}
|
||||
else {
|
||||
[ Boolean : b]
|
||||
[ Boolean : b]
|
||||
result := entry("hello");
|
||||
}
|
||||
result := c(f);
|
||||
|
11
tests/sprint3/test/sp3_arr_reserve.alpha
Normal file
11
tests/sprint3/test/sp3_arr_reserve.alpha
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
type main: string -> integer
|
||||
function entry: main
|
||||
type t: 3 -> integer
|
||||
|
||||
|
||||
entry (arg) := {
|
||||
[ t:a]
|
||||
a := reserve a(1, 3, 4);
|
||||
return 0;
|
||||
}
|
@ -14,7 +14,7 @@ bar (r,s) := {
|
||||
*)
|
||||
entry (arg) := {
|
||||
[ Boolean:x ; Boolean:y ; Boolean:z ; Boolean:t]
|
||||
if ( ( x < y ) (* < ( z & t )*)) then {
|
||||
if ( ( x & y ) ) then {
|
||||
|
||||
(*
|
||||
if ( x<y & !(x=y) ) then {
|
||||
@ -23,7 +23,7 @@ entry (arg) := {
|
||||
}
|
||||
*)
|
||||
|
||||
z := 9;
|
||||
z := x < y;
|
||||
} else {
|
||||
y := true; (* bar('c', 7); *)
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ bar (r,s) := {
|
||||
|
||||
entry (arg) := {
|
||||
[ Boolean:x ; Boolean:y ; Boolean:z ; Boolean:t]
|
||||
while ( !( x & y ) (* | ( z | t ) *) ) {
|
||||
while ( ( x | y ) (* | ( z | t ) *) ) {
|
||||
(*
|
||||
if ( ( x < y ) & ( z = t ) ) then {
|
||||
y := z < t;
|
||||
@ -20,7 +20,7 @@ entry (arg) := {
|
||||
t := z = t;
|
||||
}
|
||||
*)
|
||||
y := true; (* bar('c', 7); *)
|
||||
y := t < z; (* bar('c', 7); *)
|
||||
}
|
||||
(* x := x & y; *)
|
||||
return 0;
|
||||
|
18
tests/sprint4/test/sp4_cg_fib.alpha
Normal file
18
tests/sprint4/test/sp4_cg_fib.alpha
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -3,8 +3,8 @@ function test: main
|
||||
|
||||
test (a) := {
|
||||
[Boolean: b; integer: x; integer: y]
|
||||
x := 1;
|
||||
character x := 1;
|
||||
y := 2;
|
||||
b := x < y;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user