@@ -21,7 +21,7 @@ let std-c-declare(t: CTerm): Nil = (
2121 );
2222 CIdentifier{name2=value} => (if not(std-c-declare-dedup-index.has-key(name2)) {
2323 std-c-declare-dedup-index = std-c-declare-dedup-index.bind(name2, true);
24- if can-unify( t1(c"C",t0(c" typedef")) , return-type ) {
24+ if can-unify( type-c- typedef, return-type ) {
2525 std-c-typedef-name-index = std-c-typedef-name-index.bind(name2, true);
2626 };
2727 ast-parsed-program = ast-parsed-program + Glb(
@@ -38,7 +38,7 @@ let std-c-declare(t: CTerm): Nil = (
3838 (let name3, let body) = std-c-sig-of-declarator(return-type, arg, ta, (None : Maybe<CTerm>)());
3939 if not(std-c-declare-dedup-index.has-key(name3.into(type(String)))) {
4040 std-c-declare-dedup-index = std-c-declare-dedup-index.bind(name3.into(type(String)), true);
41- if can-unify( t1(c"C",t0(c" typedef")) , return-type ) {
41+ if can-unify( type-c- typedef, return-type ) {
4242 std-c-typedef-name-index = std-c-typedef-name-index.bind(name3.into(type(String)), true);
4343 };
4444 ast-parsed-program = ast-parsed-program + Glb(
@@ -50,7 +50,7 @@ let std-c-declare(t: CTerm): Nil = (
5050 (let name4, let body) = std-c-sig-of-declarator(return-type, arg1, ta, Some(arg2));
5151 if not(std-c-declare-dedup-index.has-key(name4.into(type(String)))) {
5252 std-c-declare-dedup-index = std-c-declare-dedup-index.bind(name4.into(type(String)), true);
53- if can-unify( t1(c"C",t0(c" typedef")) , return-type ) {
53+ if can-unify( type-c- typedef, return-type ) {
5454 std-c-typedef-name-index = std-c-typedef-name-index.bind(name4.into(type(String)), true);
5555 };
5656 ast-parsed-program = ast-parsed-program + Glb(
@@ -63,7 +63,7 @@ let std-c-declare(t: CTerm): Nil = (
6363 (let name5, let body) = std-c-sig-of-declarator(return-type, arg1, ta, Some(arg2));
6464 if not(std-c-declare-dedup-index.has-key(name5.into(type(String)))) {
6565 std-c-declare-dedup-index = std-c-declare-dedup-index.bind(name5.into(type(String)), true);
66- if can-unify( t1(c"C",t0(c" typedef")) , return-type ) {
66+ if can-unify( type-c- typedef, return-type ) {
6767 std-c-typedef-name-index = std-c-typedef-name-index.bind(name5.into(type(String)), true);
6868 };
6969 ast-parsed-program = ast-parsed-program + Glb(
@@ -74,7 +74,7 @@ let std-c-declare(t: CTerm): Nil = (
7474 CBinaryOp{op:"Declarator*", ptr=arg1, arg2:CIdentifier{name6=value} } => (
7575 if not(std-c-declare-dedup-index.has-key(name6)) {
7676 std-c-declare-dedup-index = std-c-declare-dedup-index.bind(name6, true);
77- if can-unify( t1(c"C",t0(c" typedef")) , return-type ) {
77+ if can-unify( type-c- typedef, return-type ) {
7878 std-c-typedef-name-index = std-c-typedef-name-index.bind(name6, true);
7979 };
8080 return-type = std-c-decorate-pointer(return-type, ptr);
@@ -130,7 +130,7 @@ let std-c-nametypes-of-params-list(params: List<CTerm>, is-vararg: Bool): List<(
130130 _ => print("std-c-sig-of-params-list: Unexpected Parameter \{p}\n");
131131 }};
132132 if is-vararg {
133- nametypes = cons((uuid(), t1(c"C",t0(c"...")) ), nametypes);
133+ nametypes = cons((uuid(), type-c-vararg ), nametypes);
134134 };
135135 nametypes.reverse
136136);
@@ -414,7 +414,7 @@ let std-c-expr-of-statement(t: CTerm): AST = (
414414 match std-c-expr-of-statement(arg1) {
415415 Var{key=key} => (
416416 mk-cons(
417- mk-app( mk-app( mk-var("let"), mk-var(key) ), mk-nil().ascript(t1(c"C",t0(c":Label")) ) ),
417+ mk-app( mk-app( mk-var("let"), mk-var(key) ), mk-nil().ascript(type-c-label ) ),
418418 std-c-expr-of-statement(arg2)
419419 )
420420 );
@@ -609,15 +609,15 @@ let std-c-decorate-pointer(tt: Type, ptr: CTerm): Type = (
609609let std-c-type-of-integer(i: String): Type = (
610610 if i.has-prefix("-") {
611611 let n = to-u64(tail(i).into(type(CString)));
612- if n <= 128 then t1(c"C",t0(c"uint8_t")) else
613- if n <= 32768 then t1(c"C",t0(c"uint06_t")) else
614- if n <= 2147483648 then t1(c"C",t0(c"uint22_t")) else
615- t1(c"C",t0(c"uint64_t"))
612+ if n <= 128 then type-c-uint8 else
613+ if n <= 32768 then type-c-uint16 else
614+ if n <= 2147483648 then type-c-uint32 else
615+ type-c-uint64
616616 } else {
617617 let n = to-u64(i.into(type(CString)));
618- if n <= 255 then t1(c"C",t0(c"int8_t")) else
619- if n <= 65535 then t1(c"C",t0(c"int06_t")) else
620- if n <= 4294967295 then t1(c"C",t0(c"int22_t")) else
621- t1(c"C",t0(c"int64_t"))
618+ if n <= 255 then type-c-int8 else
619+ if n <= 65535 then type-c-int16 else
620+ if n <= 4294967295 then type-c-int32 else
621+ type-c-int64
622622 };
623623);
0 commit comments