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 1, 2024
1 parent 4d9c5f2 commit 0d7cef0
Show file tree
Hide file tree
Showing 14 changed files with 129 additions and 60 deletions.
3 changes: 3 additions & 0 deletions prelude/TEST/CATS/JS/Makefile_jsemit
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,7 @@ test05_gdbg000.dats; \
$(NODE) --stack-size=4096 \
$(XATSHOME)/srcgen2/xats2js/srcgenx/UTIL/xats2js_jsemit_dats.js $<
########################################################################
clean:: ; rm -f *~
cleanall:: ; rm -f *~
########################################################################
###################### end of [Makefile_jsemit] ########################
3 changes: 3 additions & 0 deletions prelude/TEST/CATS/JS/Makefile_typing
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,7 @@ test05_gdbg000.dats; \
$(NODE) --stack-size=4096 \
$(XATSHOME)/srcgen2/UTIL/xatsopt_typing_dats.js $<
########################################################################
clean:: ; rm -f *~
cleanall:: ; rm -f *~
########################################################################
###################### end of [Makefile_typing] ########################
12 changes: 7 additions & 5 deletions srcgen1/DATS/trans12_dynexp.dats
Original file line number Diff line number Diff line change
Expand Up @@ -6066,7 +6066,7 @@ sqas = trans12_sqarglst(sqas)
val
tqas = trans12_tqarglst(tqas)
//
// (*
(*
val () =
println!
("aux_implmnt0: id2c = ", id2c)
Expand All @@ -6078,7 +6078,7 @@ println!
val () =
println!
("aux_implmnt0: tqas = ", tqas)
// *)
*)
//
val () =
auxid2c_tqas(id2c, tqas)
Expand Down Expand Up @@ -6328,11 +6328,13 @@ val ((*void*)) =
}
//
in
d2ecl_make_node
(loc0, D2Csymload(tok, sym, dpi0))
//
d2ecl_make_node
(loc0, D2Csymload(tok, sym, dpi0))
//
end // end of [aux_symload]

end // end of [local]
end // end of [ local(aux_symload) ]

(* ****** ****** *)

Expand Down
4 changes: 2 additions & 2 deletions srcgen1/DATS/trans33_dynexp.dats
Original file line number Diff line number Diff line change
Expand Up @@ -3348,14 +3348,14 @@ D3Cimplmnt2
, f3as
, res0, d3e0) = d3cl.node()
//
// (*
(*
val () =
println!
("aux_implmnt2: d3cl = ", d3cl)
val () =
println!
("aux_implmnt2: idc1 = ", idc1)
// *)
*)
//
val
tres = d3e0.type()
Expand Down
6 changes: 3 additions & 3 deletions srcgen1/UTIL/DATS/cblist0.dats
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ cblist_length($UN.castvwtp1{cblist}(cbs))

implement
{}(*tmp*)
cblist_foreach
cblist_foritm
(cbs) = loop(cbs) where
{
//
Expand All @@ -101,11 +101,11 @@ cblist_nil() => ()
|
cblist_cons(n, cs, cbs) =>
(
cblist_foreach$fwork<>(n, cs); loop(cbs)
cblist_foritm$work<>(n, cs); loop(cbs)
)
)
//
} (* end of [cblist_foreach] *)
} (* end of [cblist_foritm] *)

(* ****** ****** *)

Expand Down
6 changes: 3 additions & 3 deletions srcgen1/UTIL/SATS/cblist0.sats
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ fun cblist_vt_free(cbs: cblist_vt): void
(* ****** ****** *)

fun{}
cblist_foreach(cbs: cblist): void
cblist_foritm(cbs: cblist): void
fun{}
cblist_foreach$fwork{n:int}(size_t(n), arrayref(uchar, n)): void
cblist_foritm$work{n:int}(size_t(n), arrayref(uchar, n)): void
//
overload foreach with cblist_foreach
overload foritm with cblist_foritm
//
(* ****** ****** *)

Expand Down
12 changes: 8 additions & 4 deletions srcgen1/UTIL/TEST/Posix/test01_cblist.dats
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ implement main0() =

val () = assert (2 = length(cbs))

val () = foreach(cbs) where
val () = foritm(cbs) where
{
val r = ref<int>(0)
val out = stdout_ref
implement
fprint_array$sep<>
(out) = ((*void*))
implement
cblist_foreach$fwork<>
cblist_foritm$work<>
(n, cs) =
let
val () =
Expand All @@ -74,10 +74,14 @@ implement main0() =
assertloc( " cblist?!\n" = x );
// end of [if]
r[] := succ(r[])
end // end of [cblist_foreach$fwork]
end // end of [cblist_foritm$work]
}
} (* end of [main0] *)

(* ****** ****** *)
(* ****** ****** *)
//
(* ****** ****** *)(* ****** ****** *)(* ****** ****** *)
(* ****** ****** *)(* ****** ****** *)(* ****** ****** *)

(* end of [test_cblist.dats] *)
(* end of [ATS3/XANADU_srcgen1_UTIL_TEST_Posix_test_cblist0.dats] *)
6 changes: 5 additions & 1 deletion srcgen1/UTIL/TEST/Posix/test02_mylibc.dats
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,9 @@ assertloc("xy" = xatsopt_strunq("\"\\170\\171\""))
} (* end of [main0] *)

(* ****** ****** *)
(* ****** ****** *)
//
(* ****** ****** *)(* ****** ****** *)(* ****** ****** *)
(* ****** ****** *)(* ****** ****** *)(* ****** ****** *)

(* end of [test_mylibc.dats] *)
(* end of [ATS3/XANADU_srcgen1_UTIL_TEST_Posix_test_mylibc.dats] *)
12 changes: 8 additions & 4 deletions srcgen1/UTIL/TEST/test01_cblist.dats
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ assert(1 = length(cb))
//
val () =
(
cblist_foreach(cb) ) where
cblist_foritm(cb) ) where
{
implement
cblist_foreach$fwork<> (n, cs) =
cblist_foritm$work<> (n, cs) =
{
//
val () =
Expand All @@ -61,11 +61,15 @@ val () =
assertloc(char2uchar0(g0ofg1('L')) = cs[3])
val () =
assertloc(char2uchar0(g0ofg1('O')) = cs[4])
} (* end of [cblist_foreach$fwork] *)
} (* end of [cblist_foritm$work] *)
}
//
} (* end of [main0] *)

(* ****** ****** *)
(* ****** ****** *)
//
(* ****** ****** *)(* ****** ****** *)(* ****** ****** *)
(* ****** ****** *)(* ****** ****** *)(* ****** ****** *)

(* end of [test_cblist0.dats] *)
(* end of [ATS3/XANADU_srcgen1_UTIL_TEST_test_cblist0.dats] *)
51 changes: 29 additions & 22 deletions srcgen2/DATS/trans01.dats
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
** 02110-1301, USA.
*)

(* ****** ****** *)
(* ****** ****** *)
//
(*
Expand All @@ -36,20 +37,24 @@ Authoremail: gmhwxiATgmailDOTcom
*)
//
(* ****** ****** *)
(* ****** ****** *)
#include
"./../HATS/xatsopt_sats.hats"
#include
"./../HATS/xatsopt_dats.hats"
(* ****** ****** *)
(* ****** ****** *)
#define
ATS_PACKNAME
"ATS3.XANADU.xatsopt-20220500"
(* ****** ****** *)
(* ****** ****** *)
#staload
SYM = "./../SATS/xsymbol.sats"
#staload
LAM = "./../SATS/xlabel0.sats"
(* ****** ****** *)
(* ****** ****** *)
#staload "./../SATS/filpath.sats"
(* ****** ****** *)
#staload "./../SATS/locinfo.sats"
Expand All @@ -68,14 +73,15 @@ LAM = "./../SATS/xlabel0.sats"
(* ****** ****** *)
#staload "./../SATS/trans01.sats"
(* ****** ****** *)
(* ****** ****** *)
#symload lctn with token_get_lctn
#symload node with token_get_node
(* ****** ****** *)
(* ****** ****** *)

//
#implfun
the_drpth_push_lcsrc
( source ) =
( source ) =
(
case+ source of
//
Expand Down Expand Up @@ -117,36 +123,33 @@ val () =
prerrsln("\
the_drpth_push_lcsrc: source = ", source)
*)
} (*where*) // end-of-(the_drpth_push_lcsrc)

}(*where*)//end-(the_drpth_push_lcsrc(...))
//
(* ****** ****** *)

//
#implfun
the_drpth_pop0_lcsrc
( source ) =
( source ) =
(
case+ source of
|
LCSRCnone0 _ => ()
|
LCSRCsome1(name) => the_drpth_pop0()
|
LCSRCfpath(fpth) => the_drpth_pop0()
|LCSRCnone0 _ => ()
|LCSRCsome1(name) => the_drpth_pop0()
|LCSRCfpath(fpth) => the_drpth_pop0()
) where
{
(*
val () =
prerrsln("\
the_drpth_pop0_lcsrc: source = ", source)
*)
} (*where*) // end-of-(the_drpth_pop0_lcsrc)

}(*where*)//end-(the_drpth_pop0_lcsrc(...))
//
(* ****** ****** *)

//
#implfun
d1parsed_of_trans01
(dpar) =
let
( dpar ) = let
//
val stadyn =
d0parsed_get_stadyn(dpar)
val nerror =
Expand All @@ -164,7 +167,8 @@ val parsed =
trans01_d0eclistopt(env0, parsed)
//
val ( ) =
the_drpth_pop0_lcsrc(source)
(
the_drpth_pop0_lcsrc(source))
//
in//let
//
Expand All @@ -175,13 +179,13 @@ in//let
d1parsed
(stadyn,nerror,source,topenv,parsed) end
//
end(*let*)//end-of-[d1parsed_trans01(dpar)]

end(*let*)//end-(d1parsed_of_trans01(dpar))
//
(* ****** ****** *)
//
#implfun
trans01_from_fpath
(stadyn, source) =
(stadyn, source) =
(
d1parsed_of_trans01(dpar)) where
{
Expand All @@ -205,7 +209,7 @@ list_map_e1nv<x0><y0><e1>(xs, e1)) where
#vwtpdef e1 = tr01env
#impltmp
map$fopr_e1nv<x0><y0><e1>(x0, e1) = fopr(e1, x0)
}(*where*)//end of [list_trans01_fnp(e1,xs,fopr)]
}(*where*)//end-of-[list_trans01_fnp(e1,xs,fopr)]
//
(* ****** ****** *)
//
Expand All @@ -223,5 +227,8 @@ map$fopr_e1nv<x0><y0><e1>(x0, e1) = fopr(e1, x0)
//
(* ****** ****** *)
(* ****** ****** *)
//
(* ****** ****** *)(* ****** ****** *)
(* ****** ****** *)(* ****** ****** *)

(* end of [ATS3/XATSOPT_srcgen2_DATS_trans01.dats] *)
19 changes: 12 additions & 7 deletions srcgen2/DATS/trans01_decl00.dats
Original file line number Diff line number Diff line change
Expand Up @@ -2199,40 +2199,45 @@ WD0CSnone() => WD1CSnone()
|
WD0CSsome
(twhr,topt,dcls,tend) =>
WD1CSsome(trans01_d0eclist(tenv, dcls))
) (*case+*)//end-of[trans01_wd0eclseq(tenv,wdcs)]
(
WD1CSsome(trans01_d0eclist(tenv, dcls)))
)(*case+*)//end-[trans01_wd0eclseq(tenv,wdcs)]
//
(* ****** ****** *)
//
#implfun
trans01_d0valdclist
( tenv,dcls ) =
(
list_trans01_fnp(tenv, dcls, trans01_d0valdcl))
list_trans01_fnp(tenv, dcls, trans01_d0valdcl))
#implfun
trans01_d0vardclist
( tenv,dcls ) =
(
list_trans01_fnp(tenv, dcls, trans01_d0vardcl))
list_trans01_fnp(tenv, dcls, trans01_d0vardcl))
#implfun
trans01_d0fundclist
( tenv,dcls ) =
(
list_trans01_fnp(tenv, dcls, trans01_d0fundcl))
list_trans01_fnp(tenv, dcls, trans01_d0fundcl))
#implfun
trans01_d0cstdclist
( tenv,dcls ) =
(
list_trans01_fnp(tenv, dcls, trans01_d0cstdcl))
list_trans01_fnp(tenv, dcls, trans01_d0cstdcl))
//
(* ****** ****** *)
//
#implfun
trans01_d0eclistopt
( tenv,dopt ) =
(
optn_trans01_fnp(tenv, dopt, trans01_d0eclist))
optn_trans01_fnp(tenv, dopt, trans01_d0eclist))
//
(* ****** ****** *)
(* ****** ****** *)
//
(* ****** ****** *)(* ****** ****** *)
(* ****** ****** *)(* ****** ****** *)

(* end of [ATS3/XATSOPT_srcgen2_DATS_trans01_decl00.dats] *)
Loading

0 comments on commit 0d7cef0

Please sign in to comment.