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 Jan 13, 2025
1 parent 756836f commit 1c7e1e0
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 6 deletions.
71 changes: 70 additions & 1 deletion srcgen2/DATS/trtmp3b_dynexp.dats
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ _(*Trtmp3b*) = "./trtmp3b.dats"
#symload lctn with d3exp_get_lctn
#symload node with d3exp_get_node
(* ****** ****** *)
#symload lctn with d3gua_get_lctn
#symload node with d3gua_get_node
(* ****** ****** *)
#symload lctn with d3gpt_get_lctn
#symload node with d3gpt_get_node
(* ****** ****** *)
Expand Down Expand Up @@ -1124,6 +1127,7 @@ D3Esynext
} (*where*)//end-of-[trtmp3b_d3exp(env0,d3e0)]
//
(* ****** ****** *)
(* ****** ****** *)
//
#implfun
trtmp3b_l3d3e
Expand All @@ -1139,6 +1143,46 @@ D3LAB(lab0, trtmp3b_d3exp(env0, d3e1))
end (*let*)//end-of-[trtmp3b_l3d3e(env0,ld3e)]
//
(* ****** ****** *)
(* ****** ****** *)
//
#implfun
trtmp3b_d3gua
(env0, dgua) = let
//
val loc0 = dgua.lctn()
//
(*
val
val () =
prerrsln
("trtmp3b_d3gua: dgua = ", dgua)
*)
//
in//let
//
case+
dgua.node() of
|
D3GUAexp(dexp) =>
let
val dexp =
trtmp3b_d3exp(env0, dexp)
in//let
d3gua(loc0, D3GUAexp(dexp))
end//let
//
|
D3GUAmat(dexp, dpat) =>
let
val dexp =
trtmp3b_d3exp(env0, dexp)
in//let
d3gua(loc0, D3GUAmat(dexp, dpat))
end//let
//
end(*let*)//end-of-[trtmp3b_d3gua(env0,dgpt)]
//
(* ****** ****** *)
//
#implfun
trtmp3b_d3gpt
Expand All @@ -1160,7 +1204,18 @@ dgpt.node() of
|
D3GPTpat(d3p1) => dgpt//nothing
|
D3GPTgua(d3p1, d3gs) => dgpt//nothing
D3GPTgua(d3p1, d3gs) =>
let
//
val loc0 =
dgpt.lctn((*void*))
val d3gs =
trtmp3b_d3gualst(env0, d3gs)
//
in//let
(
d3gpt(loc0, D3GPTgua(d3p1, d3gs)))
end//let
//
end(*let*)//end-of-[trtmp3b_d3gpt(env0,dgpt)]
//
Expand Down Expand Up @@ -1230,6 +1285,7 @@ TEQD3EXPsome(teq1, d3e2) where
(*case+*)//end-of(trtmp3b_teqd3exp(env0,tdxp))
//
(* ****** ****** *)
(* ****** ****** *)
//
#implfun
trtmp3b_d3explst
Expand All @@ -1252,6 +1308,15 @@ trtmp3b_l3d3elst
list_trtmp3b_fnp(env0, ldes, trtmp3b_l3d3e))
//
(* ****** ****** *)
(* ****** ****** *)
//
#implfun
trtmp3b_d3gualst
( env0, d3gs ) =
(
list_trtmp3b_fnp(env0, d3gs, trtmp3b_d3gua))
//
(* ****** ****** *)
//
#implfun
trtmp3b_d3clslst
Expand All @@ -1260,5 +1325,9 @@ trtmp3b_d3clslst
list_trtmp3b_fnp(env0, dcls, trtmp3b_d3cls))
//
(* ****** ****** *)
(* ****** ****** *)
//
(* ****** ****** *)(* ****** ****** *)(* ****** ****** *)
(* ****** ****** *)(* ****** ****** *)(* ****** ****** *)

(* end of [ATS3/XATSOPT_srcgen2_DATS_trtmp3b_dynexp.dats] *)
9 changes: 9 additions & 0 deletions srcgen2/SATS/trtmp3b.sats
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,11 @@ trtmp3b_l3d3e
(* ****** ****** *)
//
fun
trtmp3b_d3gua
( env0:
! tr3benv,dgua:d3gua):d3gua//fun
//
fun
trtmp3b_d3gpt
( env0:
! tr3benv,dgpt:d3gpt):d3gpt//fun
Expand Down Expand Up @@ -326,6 +331,10 @@ trtmp3b_l3d3elst
(* ****** ****** *)
//
fun
trtmp3b_d3gualst
( env0:
! tr3benv,d3gs:d3gualst):d3gualst
fun
trtmp3b_d3clslst
( env0:
! tr3benv,dcls:d3clslst):d3clslst
Expand Down
9 changes: 4 additions & 5 deletions srcgen2/SATS/trtmp3c.sats
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,13 @@ Template resolution is the engine
of programming productivity for ATS3!
This implementation is primarily for
the moment; some form of internet-based
search will be attempted later :)
search will surely be attempted later :)
*)
(* ****** ****** *)
(*
HX-2023-11-09:
For handling recursive template
resolution. The non-recursive case
is handled in [trtmp3b].
For handling recursive template resolution.
The non-recursive case is handled in [trtmp3b].
*)
(* ****** ****** *)
(*
Expand All @@ -71,7 +70,7 @@ The basic idea of this implementaion:
2. Traverse the stack of impltmps to remove the first matching candidate
if it is already used and non-recursive
3. Step 2 is repeated until either a recursive matching case or an unused
non-recursive matching case is found, which is chosen
non-recursive matching case is found, which is then chosen.
*)
(* ****** ****** *)
#absvtbx
Expand Down

0 comments on commit 1c7e1e0

Please sign in to comment.