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 12, 2025
1 parent bb0957b commit 0422ad3
Show file tree
Hide file tree
Showing 5 changed files with 174 additions and 5 deletions.
4 changes: 2 additions & 2 deletions srcgen2/xats2js/srcgen1/DATS/js1emit_decl00.dats
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ dimp.node() of
|DIMPLone1
( dcst ) =>
(
d2cstfpr(filr, dcst))
d2cstjs1(filr, dcst))
|DIMPLone2
(dcst, svts) =>
(
d2cstfpr(filr, dcst))
d2cstjs1(filr, dcst))
|DIMPLall1
(dqid, d2cs) =>
(
Expand Down
6 changes: 3 additions & 3 deletions srcgen2/xats2js/srcgen1/DATS/js1emit_dynexp.dats
Original file line number Diff line number Diff line change
Expand Up @@ -897,13 +897,13 @@ ival.node() of
( itnm ) => i1tnmjs1(filr,itnm)
(* ****** ****** *)
|I1Vcon
( dcon ) => d2confpr(filr,dcon)
( dcon ) => d2conjs1(filr,dcon)
(* ****** ****** *)
|I1Vcst
( dcst ) => d2cstfpr(filr,dcst)
( dcst ) => d2cstjs1(filr,dcst)
(* ****** ****** *)
|I1Vvar
( dvar ) => d2varfpr(filr,dvar)
( dvar ) => d2varjs1(filr,dvar)
(* ****** ****** *)
(* ****** ****** *)
//
Expand Down
151 changes: 151 additions & 0 deletions srcgen2/xats2js/srcgen1/DATS/js1emit_utils0.dats
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,20 @@ Authoremail: gmhwxiATgmailDOTcom
"./../../../SATS/lexing0.sats"
//
(* ****** ****** *)
//
#staload // S2E =
"./../../../SATS/staexp2.sats"
#staload // T2P =
"./../../../SATS/statyp2.sats"
#staload // D2E =
"./../../../SATS/dynexp2.sats"
//
(* ****** ****** *)
//
#staload // GLO =
"./../../../SATS/xglobal.sats"
//
(* ****** ****** *)
(* ****** ****** *)
//
#staload "./../SATS/intrep0.sats"
Expand All @@ -70,13 +84,150 @@ Authoremail: gmhwxiATgmailDOTcom
#staload "./../SATS/js1emit.sats"
//
(* ****** ****** *)
(* ****** ****** *)
//
#staload
_(*DATS*)="./../DATS/js1emit.dats"
//
(* ****** ****** *)
(* ****** ****** *)
//
#symload lctn with d2con_get_lctn
#symload lctn with d2cst_get_lctn
#symload lctn with d2var_get_lctn
//
#symload name with d2con_get_name
#symload name with d2cst_get_name
#symload name with d2var_get_name
//
(* ****** ****** *)
#symload lctn with d2exp_get_lctn
#symload node with d2exp_get_node
(* ****** ****** *)
(* ****** ****** *)
//
fun
xsymjs1
( filr: FILR
, xsym: symbl): void =
symbl_fprint(filr, xsym)
//
(* ****** ****** *)
(* ****** ****** *)
//
#implfun
d2conjs1
(filr, dcon) =
(*
d2confpr(filr, dcon)
*)
let
//
val name = dcon.name((*0*))
//
in//let
(
xsymjs1
(filr, name);
strnfpr(filr, "_");
fprint_loctn_as_stamp
(filr, dcon.lctn((*void*))))
end(*let*)//end-of-[d2conjs1(env0,dcon)]
//
(* ****** ****** *)
//
#implfun
d2cstjs1
(filr, dcst) =
(*
d2cstfpr(filr, dcst)
*)
let
//
val stmp =
d2cst_get_stmp(dcst)
val xopt =
the_d2cstmap_xnmfind(stmp)
//
in//let
(
case+
xopt of
| ~
optn_vt_nil
( (*0*) ) => f0_none(dcst)
| ~
optn_vt_cons
( xnam ) =>
(
case+ xnam of
|X2NAMnone
( (*0*) ) => f0_none(dcst)
|X2NAMsome
( dexp ) => f0_some(dcst, dexp)
)
) where
{
//
fun
f0_none
(dcst: d2cst): void =
let
val lctn = dcst.lctn((*0*))
val name = dcst.name((*0*))
//
in//let
xsymjs1
(filr, name);
strnfpr(filr, "_");
fprint_loctn_as_stamp(filr, lctn)
end//let//end-of-[f0_none]
//
fun
f0_some
(dcst: d2cst
,dexp: d2exp): void =
let
//
val name = dcst.name((*0*))
//
val-
D2Eextnam
(tknd, gnam) = dexp.node((*0*))
//
in//let
case+ gnam of
|
_(* else *) => xsymjs1(filr, name)
end(*let*)//end-of-[f0_some(dcst,dexp)]
//
}(*where*)
end(*let*)//end-of-[d2cstjs1(env0,dcst)]
//
(* ****** ****** *)
//
#implfun
d2varjs1
(filr, dvar) =
(*
d2varfpr(filr, dvar)
*)
let
//
val name = dvar.name((*0*))
//
in//let
(
xsymjs1
(filr, name);
strnfpr(filr, "_");
fprint_loctn_as_stamp
(filr, dvar.lctn((*void*))))
end(*let*)//end-of-[d2varjs1(env0,dvar)]
//
(* ****** ****** *)
(* ****** ****** *)
//
#implfun
i1tnmjs1
( filr,itnm ) =
Expand Down
17 changes: 17 additions & 0 deletions srcgen2/xats2js/srcgen1/SATS/js1emit.sats
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,23 @@ XATSOPT "./../../.."
(* ****** ****** *)
//
fun
d2conjs1
(filr
:FILR, dcon: d2con): void
fun
d2cstjs1
(filr
:FILR, dcst: d2cst): void
//
fun
d2varjs1
(filr
:FILR, dvar: d2var): void
//
(* ****** ****** *)
(* ****** ****** *)
//
fun
i1tnmjs1
(filr:FILR,itnm:i1tnm): void
//
Expand Down
1 change: 1 addition & 0 deletions srcgen2/xats2py/srcgen1/SATS/py1emit.sats
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ d2varpy1
:FILR, dvar: d2var): void
//
(* ****** ****** *)
(* ****** ****** *)
//
fun
i1tnmpy1
Expand Down

0 comments on commit 0422ad3

Please sign in to comment.