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 9, 2024
1 parent 3bd6825 commit 038baf6
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 6 deletions.
2 changes: 1 addition & 1 deletion prelude/DATS/CATS/JS/gbas000.cats
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ XATS2JS_strn_dflt$parse$fwork
(rep0, work)
{
let f0 = parseFloat(rep0)
if (!isNaN(i0)) { work(f0) }; return
if (!isNaN(f0)) { work(f0) }; return
}
//
////////////////////////////////////////////////////////////////////////.
Expand Down
5 changes: 5 additions & 0 deletions srcgen2/prelude/HATS/prelude_JS_dats.hats
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ Sun 14 Jul 2024 12:14:49 PM EDT
(* ****** ****** *)
//
#staload _ =
"prelude/DATS/CATS/JS/gbas000.dats"
//
(* ****** ****** *)
//
#staload _ =
"prelude/DATS/CATS/JS/bool000.dats"
//
(* ****** ****** *)
Expand Down
4 changes: 2 additions & 2 deletions srcgen2/xats2js/srcgen1/xshared/runtime/xats2js_prelude.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Mon 09 Sep 2024 09:39:08 AM EDT
// Mon 09 Sep 2024 12:44:07 PM EDT
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/*
Expand Down Expand Up @@ -576,7 +576,7 @@ XATS2JS_strn_dflt$parse$fwork
(rep0, work)
{
let f0 = parseFloat(rep0)
if (!isNaN(i0)) { work(f0) }; return
if (!isNaN(f0)) { work(f0) }; return
}
//
////////////////////////////////////////////////////////////////////////.
Expand Down
2 changes: 1 addition & 1 deletion srcgen2/xats2js/srcgen1/xshared/runtime/xats2js_xatslib.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Mon 09 Sep 2024 09:39:08 AM EDT
// Mon 09 Sep 2024 12:44:07 PM EDT
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
/*
Expand Down
3 changes: 2 additions & 1 deletion xatslib/githwxi/DATS/CATS/JS/mycsv00.cats
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ XATS2JS_NODE_mycsv00$line_csv$parse$fwork
{
try {
let parsed =
XATS2JS_NODE_Papa.parse(line); work(parsed.data[0])
XATS2JS_NODE_Papa.parse(line);
if (parsed.data.length > 0) work(parsed.data[0]);
} catch (error) {
console.log
(`XATS2JS_NODE_mycsv00$fpath_readall$fwork(error): line = ${line}`)
Expand Down
2 changes: 1 addition & 1 deletion xatslib/githwxi/TEST/CATS/JS/test06_mycsv00.dats
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ gseq_end<xs><x0>() = "\n)"
gseq_beg<xs><x0>() = "strm_vt(\n"
//
#impltmp
gseq_prlen<xs><x0>() = 10
gseq_prlen<xs><x0>() = (20)
//
in//local
val () = print0s("opts = ", opts, "\n")
Expand Down
51 changes: 51 additions & 0 deletions xatslib/githwxi/TEST/CATS/JS/test08_volctrl.dats
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,57 @@ optn_vt_cons(hdr0) = hdr0
val ( ) = prints("hdr0 = ", hdr0, "\n")
//
(* ****** ****** *)
//
#typedef
row = a1sz(strn)
//
fun
myrow_opt$make
( opt
: optn_vt(row)
) : myobj =
myobj_fmake_fwork
(
lam(work) =>
(
case+ opt of
| ~
optn_vt_nil() => ()
| ~
optn_vt_cons(row) =>
(
work("Date" , dflt(row[0]));
work("AdjClose", dflt(row[5])))
)
) where
{
fun
dflt(rep: strn): dtval =
DTVdflt(head0(g_parse$opt<dflt>(rep)))
}
//
(* ****** ****** *)
//
fun
myrows_opts$make
( opts
: strm_vt(
optn_vt(row))): a1sz(myobj) =
a1sz_fmake_fwork(
lam(work) =>
strm_vt_foritm0_f1un
(
opts,
lam(opt) => work(myrow_opt$make(opt))))
//
(* ****** ****** *)
(* ****** ****** *)
//
val rows = myrows_opts$make(opts)
val ( ) =
prints("|rows| = ", length(rows), "\n")
//
(* ****** ****** *)
(* ****** ****** *)
//
(*
Expand Down

0 comments on commit 038baf6

Please sign in to comment.