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 11, 2024
1 parent 75cebc9 commit 637966d
Show file tree
Hide file tree
Showing 12 changed files with 379 additions and 168 deletions.
2 changes: 1 addition & 1 deletion prelude/DATS/unsfx00.dats
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ end(*let*)//end-of-[$UN.gasz_setf$at$raw(...)]
//
#impltmp
<(*tmp*)>
strn_head$raw(cs) = strn_get$at$raw<>(cs, 0)
$UN.strn_head$raw(cs) = $UN.strn_get$at$raw<>(cs, 0)
//
(* ****** ****** *)
(* ****** ****** *)
Expand Down
37 changes: 37 additions & 0 deletions prelude/SATS/VT/list001_vt.sats
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,43 @@ list_vt_nchoose0_lstrm$llist
(* ****** ****** *)
(* ****** ****** *)
//
fun
<x0:vt>
<y0:vt>
list_vt_map0
{ln:nat}
(xs: ~list_vt(x0, ln)): list_vt(y0, ln)
fun
<x0:vt>
<y0:vt>
list_vt_map1
{ln:nat}
(xs: !list_vt(x0, ln)): list_vt(y0, ln)
//
#symload map0 with list_vt_map0 of 1000
#symload map1 with list_vt_map1 of 1000
//
fun
<x0:vt>
<y0:vt>
list_vt_map0_f1un
{ln:nat}
(xs:
~list_vt(x0, ln), (~x0)->y0): list_vt(y0, ln)
fun
<x0:vt>
<y0:vt>
list_vt_map1_f1un
{ln:nat}
(xs:
!list_vt(x0, ln), (!x0)->y0): list_vt(y0, ln)
//
#symload map0_fun with list_vt_map0_f1un of 1000
#symload map1_fun with list_vt_map1_f1un of 1000
//
(* ****** ****** *)
(* ****** ****** *)
//
(* ****** ****** *)(* ****** ****** *)(* ****** ****** *)
(* ****** ****** *)(* ****** ****** *)(* ****** ****** *)

Expand Down
8 changes: 8 additions & 0 deletions prelude/SATS/list001.sats
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ list_map_f1un
//
#symload map with list_map of 1000
#symload map with list_map_f1un of 1000
#symload map_fun with list_map_f1un of 1000
#symload list_map with list_map_f1un of 1000
//
(* ****** ****** *)
//
Expand All @@ -212,6 +214,8 @@ list_map_f1un_vt
//
#symload map_vt with list_map_vt of 1000
#symload map_vt with list_map_f1un_vt of 1000
#symload map_fun_vt with list_map_f1un_vt of 1000
#symload list_map_vt with list_map_f1un_vt of 1000
//
(* ****** ****** *)
(* ****** ****** *)
Expand All @@ -231,6 +235,8 @@ list_maprev_f1un
//
#symload maprev with list_maprev of 1000
#symload maprev with list_maprev_f1un of 1000
#symload maprev_fun with list_maprev_f1un of 1000
#symload list_maprev with list_maprev_f1un of 1000
//
(* ****** ****** *)
//
Expand All @@ -249,6 +255,8 @@ list_maprev_f1un_vt
//
#symload maprev_vt with list_maprev_vt of 1000
#symload maprev_vt with list_maprev_f1un_vt of 1000
#symload maprev_fun_vt with list_maprev_f1un_vt of 1000
#symload list_maprev_vt with list_maprev_f1un_vt of 1000
//
(* ****** ****** *)
(* ****** ****** *)
Expand Down
3 changes: 3 additions & 0 deletions prelude/basics0.sats
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,9 @@ list_vt2t
(*
#symload nil with list_nil
#symload cons with list_cons
*)
//
(*
#symload nil with list_vt_nil
#symload cons with list_vt_cons
#symload lnil with list_vt_nil
Expand Down
2 changes: 1 addition & 1 deletion srcgen2/DATS/xstamp0_tmpmap.dats
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ XATS2JS_jsobjmap_make_nil<key>()
tmpmap_strmize
{itm:tbox}(map) =
(
gmap_strmize<gmap><key,itm>(map)
gmap_strmize<gmap><key><itm>(map)
) where
{
#typedef gmap = jsobjmap(key, itm) }
Expand Down
2 changes: 1 addition & 1 deletion srcgen2/DATS/xsymmap_topmap.dats
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ XATS2JS_jsobjmap_make_nil<key>()
#implfun
topmap_strmize{itm}(map) =
(
gmap_strmize<gmap><key,itms>(map)
gmap_strmize<gmap><key><itms>(map)
) where
{
#typedef itms = list(itm)
Expand Down
16 changes: 6 additions & 10 deletions srcgen2/SATS/dynexp3.sats
Original file line number Diff line number Diff line change
Expand Up @@ -303,21 +303,17 @@ d3pat_node =
//
|D3Pdap1 of (d3pat)//argless
//
|
D3Pdapp of
( d3pat
, sint(*npf*), d3patlst(*darg*)
|D3Pdapp of
(d3pat
,sint(*npf*), d3patlst(*darg*)
) (* D3Pdapp *)
//
|
D3Ptup0 of (sint(*npf*), d3patlst)
|D3Ptup0 of (sint(*npf*), d3patlst)
//
|
D3Ptup1 of
|D3Ptup1 of
(
token(*knd*), sint(*npf*), d3patlst)
|
D3Prcd2 of
|D3Prcd2 of
(
token(*knd*), sint(*npf*), l3d3plst)
//
Expand Down
220 changes: 72 additions & 148 deletions srcgen2/xats2js/srcgen1/DATS/js1emit_dynexp.dats
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,24 @@ ipat.node() of
|I0Pany _ => ((*void*))
|I0Pvar _ => ((*void*))
//
(*
|I0Pint _ =>
(
f0_int0(b0, ival, ipat))
|I0Pbtf _ =>
(
f0_btf0(b0, ival, ipat))
|I0Pchr _ =>
(
f0_chr0(b0, ival, ipat))
*)
|I0Pstr _ =>
(
f0_str0(b0, ival, ipat))
//
|I0Pdap1 _ =>
(
f0_dap1(b0, ival, ipat))
|I0Pdapp _ =>
(
f0_dapp(b0, ival, ipat))
Expand All @@ -289,6 +307,56 @@ conj(b0); prints('"',ipat,'"'))
(* ****** ****** *)
//
and
f0_str0
( b0: sint
, ival: i1val
, ipat: i0pat): void =
let
//
val-
I0Pstr
( tstr ) = ipat.node()
//
#impltmp
g_print
<token>(x) = i0strjs1(filr, x)
#impltmp
g_print
<i1val>(x) = i1valjs1(filr, x)
//
in//let
(conj(b0)
;print("XATS000_streq(")
;prints(ival, ", ", tstr, ")"))
end(*let*)//end-of-[f0_str0(...)]
//
(* ****** ****** *)
//
and
f0_dap1
( b0: sint
, ival: i1val
, ipat: i0pat): void =
let
//
val-
I0Pdap1
( i0f0 ) = ipat.node()
//
#impltmp
g_print
<i0pat>(x) = i0ctgjs1(filr, x)
#impltmp
g_print
<i1val>(x) = i1valjs1(filr, x)
//
in//let
(conj(b0)
;print("XATS000_ctgeq(")
;prints(ival, ", ", i0f0, ")"))
end(*let*)//end-of-[f0_dap1(...)]
//
and
f0_dapp
( b0: sint
, ival: i1val
Expand Down Expand Up @@ -561,150 +629,6 @@ _(* else *) => print("...I1DCL...")
(* ****** ****** *)
(* ****** ****** *)
//
fun
i1intjs1
( filr: FILR
, tint: token): void =
(
case-
tint.node() of
|T_INT01
( rep ) => prints
("XATSINT1(", rep, ")")
|T_INT02
(bas,rep) => prints
("XATSINT2(",bas,",",rep,")")
|T_INT03
(bas
,rep,sfx) => prints
("XATSINT3("
,bas, ",", rep, ",", sfx, ")")
) where
{
#impltmp g_print$out<>() = filr
}(*where*)//end-of-[i1intjs1(...)]
//
(* ****** ****** *)
//
fun
i1btfjs1
( filr: FILR
, btf0: symbl): void =
(
if
(btf0 = TRUE_symbl)
then print("XATSBOOL(true)")
else print("XATSBOOL(false)")
) where
{
#impltmp g_print$out<>() = filr
}(*where*)//end-of-[i1btfjs1(...)]
//
(* ****** ****** *)
//
fun
i1chrjs1
( filr: FILR
, tchr: token): void =
(
//
case-
tchr.node() of
|
T_CHAR1_nil0 _ =>
prints("XATSCNUL(", ")")
|
T_CHAR2_char(rep) =>
prints("XATSCHAR(", rep, ")")
|
T_CHAR3_blsh(rep) =>
prints("XATSCHAR(", rep, ")")
//
) where
{
#impltmp g_print$out<>() = filr
}(*where*)//end-of-[i1chrjs1(...)]
//
(* ****** ****** *)
//
fun
i1strjs1
( filr: FILR
, tstr: token): void =
let
//
#impltmp
g_print$out<>() = filr
//
in//let
//
case-
tstr.node() of
|
T_STRN1_clsd
( rep1,len2 ) =>
(
print
("XATSSTRN(");
f0_strn(rep1, len2); print(")"))
|
T_STRN2_ncls
( rep1,len2 ) =>
(
print
("XATSSTRN(\"");
f0_strn(rep1, len2); print("\")"))
//
end where // end-of-[let]
{
//
fun
f0_strn
(rep1: strn
,len2: sint): void =
(
strn_iforitm(rep1)) where
{
#impltmp
iforitm$work
<cgtz>(i0, ch) =
(
case+ ch of
| '"' =>
strn_fprint(filr, "\"")
(*
if
(0 = i0)
then
strn_fprint(filr, "\"")
else
if
(i0+1 = len2)
then
strn_fprint(filr, "\"")
else
strn_fprint(filr, "\\\"")
*)
//
| '\n' => strn_fprint(filr, "\\n")
| '\t' => strn_fprint(filr, "\\t")
//
| '\b' => strn_fprint(filr, "\\b")
| '\f' => strn_fprint(filr, "\\f")
//
| '\g' => strn_fprint(filr, "\\g")
//
| '\v' => strn_fprint(filr, "\\v")
//
| _(*else*) => char_fprint(filr, ch)
)
}
//
}(*where*)//end-of-[i1strjs1(filr,tstr)]
//
(* ****** ****** *)
(* ****** ****** *)
//
#implfun
fjas1js1
(filr,fjas) =
Expand Down Expand Up @@ -791,16 +715,16 @@ ival.node() of
(* ****** ****** *)
(* ****** ****** *)
|I1Vint
( tint ) => i1intjs1(filr,tint)
( tint ) => i0intjs1(filr,tint)
(* ****** ****** *)
|I1Vbtf
( btf0 ) => i1btfjs1(filr,btf0)
( btf0 ) => i0btfjs1(filr,btf0)
(* ****** ****** *)
|I1Vchr
( tchr ) => i1chrjs1(filr,tchr)
( tchr ) => i0chrjs1(filr,tchr)
(* ****** ****** *)
|I1Vstr
( tstr ) => i1strjs1(filr,tstr)
( tstr ) => i0strjs1(filr,tstr)
(* ****** ****** *)
(* ****** ****** *)
//
Expand Down
Loading

0 comments on commit 637966d

Please sign in to comment.