I added some more backpatching and some more files for testing

This commit is contained in:
Meyer Simon
2025-05-04 17:43:08 -04:00
parent 9d98b75bc0
commit accb21c78a
8 changed files with 113 additions and 18 deletions

View File

@ -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);

View 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;
}

View File

@ -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); *)
}

View File

@ -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;

View File

@ -0,0 +1,18 @@

View File

@ -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;
}
}