Skip to content

Commit

Permalink
Updating: very very minorly
Browse files Browse the repository at this point in the history
  • Loading branch information
githwxi committed Sep 5, 2024
1 parent 8b823a4 commit 4053767
Show file tree
Hide file tree
Showing 10 changed files with 282 additions and 46 deletions.
83 changes: 83 additions & 0 deletions prelude/DATS/tupl000.dats
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,89 @@ end // end of [g_print<t0up4>(tup)]
(* ****** ****** *)
(* ****** ****** *)
//
#impltmp
{ a0:t0
, a1:t0
, a2:t0
, a3:t0
, a4:t0 }
g_print
<t0up(a0,a1,a2,a3,a4)>
( tup ) =
let
//
val () =
strn_print("@(")
val () =
g_print<a0>(tup.0)
//
val () = pstrn(",")
val () =
g_print<a1>(tup.1)
//
val () = pstrn(",")
val () =
g_print<a2>(tup.2)
//
val () = pstrn(",")
val () =
g_print<a3>(tup.3)
//
val () = pstrn(",")
val () =
g_print<a4>(tup.4)
//
val () = strn_print(")")
//
end // end of [g_print<t0up5>(tup)]
//
(* ****** ****** *)
(* ****** ****** *)
//
#impltmp
{ a0:t0
, a1:t0
, a2:t0
, a3:t0
, a4:t0
, a5:t0 }
g_print
<t0up(a0,a1,a2,a3,a4,a5)>
( tup ) =
let
//
val () =
strn_print("@(")
val () =
g_print<a0>(tup.0)
//
val () = pstrn(",")
val () =
g_print<a1>(tup.1)
//
val () = pstrn(",")
val () =
g_print<a2>(tup.2)
//
val () = pstrn(",")
val () =
g_print<a3>(tup.3)
//
val () = pstrn(",")
val () =
g_print<a4>(tup.4)
//
val () = pstrn(",")
val () =
g_print<a5>(tup.5)
//
val () = strn_print(")")
//
end // end of [g_print<t0up6>(tup)]
//
(* ****** ****** *)
(* ****** ****** *)
//
(* ****** ****** *)(* ****** ****** *)
(* ****** ****** *)(* ****** ****** *)

Expand Down
17 changes: 17 additions & 0 deletions prelude/TEST/CATS/JS/Makefile_jsemit
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,23 @@ test06:: \
test06_list000.dats; \
$(NODE) --stack-size=4096 $(SRCGEN2_XATS2JS) $< >> $@_out.js
########################################################################
########################################################################
test99:: ; \
echo "//" `date` > $@_out.js
############
test99:: ; \
$(CAT) $(SRCGEN2_XSHARED)/xats2js_js1emit.js >> $@_out.js
test99:: ; \
$(CAT) $(SRCGEN2_XSHARED)/xats2js_prelude.js >> $@_out.js
############
test99:: ; \
$(CAT) $(XATSHOME)/prelude/DATS/CATS/JS/NODE/node000.cats >> $@_out.js
############
test99:: \
test99_mydiary.dats; \
$(NODE) --stack-size=4096 $(SRCGEN2_XATS2JS) $< >> $@_out.js
########################################################################
########################################################################
clean:: ; rm -f *~
cleanall:: ; rm -f *~
cleanall:: ; rm -f test??_out.js
Expand Down
5 changes: 5 additions & 0 deletions prelude/TEST/CATS/JS/Makefile_typing
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
########################################################################
########################################################################
# Makefile for type-checking
########################################################################
########################################################################
NODE=node
########################################################################
########################################################################
all:: test01
all:: test02
all:: test03
all:: test04
all:: test05
all:: test06
########################################################################
########################################################################
test01: \
test01_a0rf000.dats; \
$(NODE) --stack-size=4096 \
Expand Down Expand Up @@ -40,6 +44,7 @@ test06_list000.dats; \
$(NODE) --stack-size=4096 \
$(XATSHOME)/srcgen2/UTIL/xatsopt_typing_dats.js $<
########################################################################
########################################################################
clean:: ; rm -f *~
cleanall:: ; rm -f *~
########################################################################
Expand Down
36 changes: 36 additions & 0 deletions prelude/TEST/CATS/JS/test99_mydiary.dats
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
(* ****** ****** *)
(*
HX-2024-08-09:
For testing prelude/JS!
*)
(* ****** ****** *)
(* ****** ****** *)
#staload _ =
"prelude/DATS/gdbg000.dats"
(* ****** ****** *)
(* ****** ****** *)
#include
"srcgen2\
/prelude/HATS/prelude_dats.hats"
(* ****** ****** *)
#include
"srcgen2\
/prelude/HATS/prelude_JS_dats.hats"
(* ****** ****** *)
#include
"srcgen2\
/prelude/HATS/prelude_NODE_dats.hats"
(* ****** ****** *)
(* ****** ****** *)
//
val () =
prints
("Hello from [test99_mydiary]!", "\n")
//
(* ****** ****** *)
(* ****** ****** *)
//
(* ****** ****** *)(* ****** ****** *)(* ****** ****** *)
(* ****** ****** *)(* ****** ****** *)(* ****** ****** *)

(* end of [ATS3/XANADU_prelude_TEST_CATS_JS_test99_mydiary.dats] *)
10 changes: 5 additions & 5 deletions srcgen1/prelude/DATS/VT/gseq000_vt.dats
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ gseq_z2forcmp0
) where
{
#impltmp
z2forcmp$fcmp0<x0><x0> = g_cmp00<x0>
z2forcmp$test0<x0><x0> = g_cmp00<x0>
}(*where*) // [gseq_cmp00/z2forcmp0]

(* ****** ****** *)
Expand Down Expand Up @@ -1012,7 +1012,7 @@ gseq_z2forcmp0
) where
{
#impltmp
z2forcmp$fcmp0<x0><x0> = g_cmp00<x0>
z2forcmp$test0<x0><x0> = g_cmp00<x0>
} (* end of [gseq_z2cmp00/z2forcmp0] *)

#impltmp
Expand All @@ -1026,7 +1026,7 @@ gseq_z2forcmp1
) where
{
#impltmp
z2forcmp$fcmp1<x0><x0> = g_cmp11<x0>
z2forcmp$test1<x0><x0> = g_cmp11<x0>
} (* end of [gseq_z2cmp11/z2forcmp1] *)

(* ****** ****** *)
Expand Down Expand Up @@ -1075,13 +1075,13 @@ strm_vt_z2forcmp0<x0><y0>
) where
{
#impltmp
z2forcmp$fcmp0<x0><y0>
z2forcmp$test0<x0><y0>
(x0, y0) =
(
g_free(x0); g_free(y0); sgn) where
{
val
sgn = z2forcmp$fcmp1<x0><y0>(x0, y0)}
sgn = z2forcmp$test1<x0><y0>(x0, y0)}
} (*where*)//end-of-[gseq_z2forcmp1]
//
(* ****** ****** *)
Expand Down
17 changes: 9 additions & 8 deletions srcgen1/prelude/DATS/VT/strm000_vt.dats
Original file line number Diff line number Diff line change
Expand Up @@ -1636,14 +1636,15 @@ strmcon_vt_nil() =>
| ~
strmcon_vt_cons(y0, ys) =>
let
val
sgn =
z2forcmp$fcmp0<x0><y0>(x0, y0)
val
sgn =
z2forcmp$test0<x0><y0>(x0, y0)
in
if
(sgn = 0)
then loop(xs, ys)
else (g_free(xs); g_free(ys); sgn)
(
if
(sgn = 0)
then loop(xs, ys)
else (g_free(xs); g_free(ys); sgn))
end // end of [strmcon_vt_cons]
)
) (*case+*)//end of [loop(xs,ys)]
Expand Down Expand Up @@ -1895,7 +1896,7 @@ strmcon_vt_cons(y0, ys) =>
let
val
sgn =
iz2forcmp$fcmp0<x0><y0>(i0, x0, y0)
iz2forcmp$test0<x0><y0>(i0, x0, y0)
in
if
(sgn = 0)
Expand Down
14 changes: 7 additions & 7 deletions srcgen1/prelude/DATS/gseq000.dats
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ gseq_z2forcmp
) where
{
#impltmp
z2forcmp$fcmp<x0><x0> = g_cmp<x0>
z2forcmp$test<x0><x0> = g_cmp<x0>
}(*where*)//end-of-[gseq_cmp/z2forcmp]
//
(* ****** ****** *)
Expand Down Expand Up @@ -2419,7 +2419,7 @@ gseq_z2forcmp
) where
{
#impltmp
z2forcmp$fcmp<x0><x0> = g_cmp<x0> }
z2forcmp$test<x0><x0> = g_cmp<x0> }
//(*where*)//end-of-[gseq_z2cmp/z2forcmp(...)]
//
(* ****** ****** *)
Expand Down Expand Up @@ -2525,7 +2525,7 @@ strm_vt_z2forcmp0<x0><y0>
) where
{
#impltmp
z2forcmp$fcmp0<x0><y0> = z2forcmp$fcmp<x0><y0>
z2forcmp$test0<x0><y0> = z2forcmp$test<x0><y0>
} (*where*) // end of [gseq_z2forcmp(...)]
//
(* ****** ****** *)
Expand Down Expand Up @@ -2699,8 +2699,8 @@ strm_vt_iz2forcmp0<x0><y0>(xs, ys)
) where
{
#impltmp
iz2forcmp$fcmp0
<x0><y0>(*x0,y0*) = iz2forcmp$fcmp<x0><y0>
iz2forcmp$test0
<x0><y0>(*x0,y0*) = iz2forcmp$test<x0><y0>
} endlet // end-of-[gseq_iz2forcmp(xs,ys)]
//
(* ****** ****** *)
Expand Down Expand Up @@ -3550,7 +3550,7 @@ gseq_z2forcmp
<xs><x0><ys><y0>(xs,ys)) where
{
#impltmp
z2forcmp$fcmp<x0><y0>(x0,y0) = f0(x0,y0)
z2forcmp$test<x0><y0>(x0,y0) = f0(x0,y0)
} (*where*)//gseq_z2forcmp_f2un(xs,ys,f0)
(* ****** ****** *)
//
Expand Down Expand Up @@ -3655,7 +3655,7 @@ gseq_iz2forcmp
<xs><x0><ys><y0>(xs,ys)) where
{
#impltmp
iz2forcmp$fcmp
iz2forcmp$test
< x0,y0 >(i0, x0, y0) = f0(i0, x0, y0)
}(*where*)//end(gseq_iz2forcmp_c3fr(xs,ys,f0))
(* ****** ****** *)
Expand Down
Loading

0 comments on commit 4053767

Please sign in to comment.