fixed everything breaking i think

This commit is contained in:
Annie
2025-05-06 21:45:09 -04:00
parent 63bdb0a470
commit e23e91477a
2 changed files with 22 additions and 21 deletions

View File

@ -1,6 +1,6 @@
(* TEST: [-asc -tc] *)
(* Type definitions *)
#include "std.alpha"
(* mapping type *)
type string2int: string -> integer
@ -9,9 +9,9 @@ type funArray: 1 -> string2int
(* record of functions *)
type funRec: [ string2int: f; string2int: g ]
type int2int: integer -> integer
(* function returning function *)
type integer_2_string2int: integer -> string2int
type integer_2_int2int: integer -> int2int
(* function returning function *)
type string2int_2_integer: string2int -> integer
@ -22,8 +22,8 @@ type iXiXc: [integer: a; integer: b; character: c]
type iic2b: iXiXc -> Boolean
(* Function declarations using the above type definitions *)
function a: string2int
function b: integer_2_string2int
function a: int2int
function b: integer_2_int2int
function c: string2int_2_integer
function d: iic2b
@ -37,8 +37,8 @@ function entry: string2int
a(x) := {
[string : s]
s := x;
x:= printInteger(x);
return 0;
}
@ -51,7 +51,7 @@ b(x) := {
c(x) := {
[string: s]
s := "Hi!";
return a(s);
return 3;
}
@ -59,11 +59,11 @@ c(x) := {
entry is the first function called
*)
entry(arg) := {
[integer: result; string2int: f; integer: temp]
temp := a("Hello");
[integer: result; int2int: f; integer: temp]
temp := 7;
f := b(temp);
result := f("ahhh");
result := c(f);
result := f(temp);
(*result := c(f);*)
if (d(1,2,'c'))
then {
result := 0;
@ -72,6 +72,6 @@ entry(arg) := {
[ Boolean : b]
result := entry("hello");
}
result := c(f);
(*result := c(f);*)
return result;
}