From b268d4a4a13b026c40dfc735ba81eed300d91742 Mon Sep 17 00:00:00 2001 From: Hongwei Date: Wed, 11 Sep 2024 23:29:16 -0400 Subject: [PATCH] Updating: very very minorly --- .../xats2js/srcgen1/DATS/js1emit_dynexp.dats | 80 ++++++++++++++++++- .../xshared/runtime/xats2js_js1emit.js | 11 ++- .../xshared/runtime/xats2js_prelude.js | 2 +- .../xshared/runtime/xats2js_xatslib.js | 2 +- 4 files changed, 89 insertions(+), 6 deletions(-) diff --git a/srcgen2/xats2js/srcgen1/DATS/js1emit_dynexp.dats b/srcgen2/xats2js/srcgen1/DATS/js1emit_dynexp.dats index e12a92c4c..d13be85e8 100644 --- a/srcgen2/xats2js/srcgen1/DATS/js1emit_dynexp.dats +++ b/srcgen2/xats2js/srcgen1/DATS/js1emit_dynexp.dats @@ -272,7 +272,6 @@ ipat.node() of |I0Pany _ => ((*void*)) |I0Pvar _ => ((*void*)) // -(* |I0Pint _ => ( f0_int0(b0, ival, ipat)) @@ -282,7 +281,6 @@ ipat.node() of |I0Pchr _ => ( f0_chr0(b0, ival, ipat)) -*) |I0Pstr _ => ( f0_str0(b0, ival, ipat)) @@ -307,6 +305,84 @@ conj(b0); prints('"',ipat,'"')) (* ****** ****** *) // and +f0_int0 +( b0: sint +, ival: i1val +, ipat: i0pat): void = +let +// +val- +I0Pint +( tint ) = ipat.node() +// +#impltmp +g_print +(x) = i0intjs1(filr, x) +#impltmp +g_print +(x) = i1valjs1(filr, x) +// +in//let +(conj(b0) +;print("XATS000_inteq(") +;prints(ival, ", ", tint, ")")) +end(*let*)//end-of-[f0_int0(...)] +// +(* ****** ****** *) +// +and +f0_btf0 +( b0: sint +, ival: i1val +, ipat: i0pat): void = +let +// +val- +I0Pbtf +( btf0 ) = ipat.node() +// +#impltmp +g_print +(x) = i0btfjs1(filr, x) +#impltmp +g_print +(x) = i1valjs1(filr, x) +// +in//let +(conj(b0) +;print("XATS000_btfeq(") +;prints(ival, ", ", btf0, ")")) +end(*let*)//end-of-[f0_btf0(...)] +// +(* ****** ****** *) +// +and +f0_chr0 +( b0: sint +, ival: i1val +, ipat: i0pat): void = +let +// +val- +I0Pchr +( tchr ) = ipat.node() +// +#impltmp +g_print +(x) = i0chrjs1(filr, x) +#impltmp +g_print +(x) = i1valjs1(filr, x) +// +in//let +(conj(b0) +;print("XATS000_chreq(") +;prints(ival, ", ", tchr, ")")) +end(*let*)//end-of-[f0_chr0(...)] +// +(* ****** ****** *) +// +and f0_str0 ( b0: sint , ival: i1val diff --git a/srcgen2/xats2js/srcgen1/xshared/runtime/xats2js_js1emit.js b/srcgen2/xats2js/srcgen1/xshared/runtime/xats2js_js1emit.js index fd110da1d..436441f87 100644 --- a/srcgen2/xats2js/srcgen1/xshared/runtime/xats2js_js1emit.js +++ b/srcgen2/xats2js/srcgen1/xshared/runtime/xats2js_js1emit.js @@ -71,10 +71,17 @@ let XATSADDR = (addr) => addr // HX: no-op let XATSFLAT = (addr) => XATS000_lvget(addr) // ////////////////////////////////////////////////////////////////////////. - +// let XATSCTAG = (_, t) => t +// +let XATS000_inteq = (x, y) => (x===y) +let XATS000_btfeq = (x, y) => (x===y) +let XATS000_chreq = (x, y) => (x===y) +// +let XATS000_streq = (x, y) => (x == y) +// let XATS000_ctgeq = (v, t) => (v[0] == t) - +// ////////////////////////////////////////////////////////////////////////. let XATS000_casef = function() diff --git a/srcgen2/xats2js/srcgen1/xshared/runtime/xats2js_prelude.js b/srcgen2/xats2js/srcgen1/xshared/runtime/xats2js_prelude.js index d4d783514..16f560ae6 100644 --- a/srcgen2/xats2js/srcgen1/xshared/runtime/xats2js_prelude.js +++ b/srcgen2/xats2js/srcgen1/xshared/runtime/xats2js_prelude.js @@ -1,4 +1,4 @@ -// Mon 09 Sep 2024 10:21:04 PM EDT +// Wed 11 Sep 2024 11:24:04 PM EDT //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// /* diff --git a/srcgen2/xats2js/srcgen1/xshared/runtime/xats2js_xatslib.js b/srcgen2/xats2js/srcgen1/xshared/runtime/xats2js_xatslib.js index 9f093a2dc..eed8aa0ff 100644 --- a/srcgen2/xats2js/srcgen1/xshared/runtime/xats2js_xatslib.js +++ b/srcgen2/xats2js/srcgen1/xshared/runtime/xats2js_xatslib.js @@ -1,4 +1,4 @@ -// Mon 09 Sep 2024 10:21:04 PM EDT +// Wed 11 Sep 2024 11:24:04 PM EDT //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// /*