From 4d24768cec86b42a0c31544ecc48a78ade36f52d Mon Sep 17 00:00:00 2001 From: Hongwei Date: Wed, 1 Jan 2025 16:27:38 -0500 Subject: [PATCH] Updating: very very minorly --- prelude/DATS/CATS/PY/xtop000.dats | 43 +++++++++++++++++++ .../xats2js/srcgen1/TEST/test01_xats2js.dats | 42 ++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 prelude/DATS/CATS/PY/xtop000.dats create mode 100644 srcgen2/xats2js/srcgen1/TEST/test01_xats2js.dats diff --git a/prelude/DATS/CATS/PY/xtop000.dats b/prelude/DATS/CATS/PY/xtop000.dats new file mode 100644 index 000000000..c38244bd6 --- /dev/null +++ b/prelude/DATS/CATS/PY/xtop000.dats @@ -0,0 +1,43 @@ +(***********************************************************************) +(* *) +(* Applied Type System *) +(* *) +(***********************************************************************) + +(* +** ATS/Xanadu - Unleashing the Potential of Types! +** Copyright (C) 2025 Hongwei Xi, ATS Trustful Software, Inc. +** All rights reserved +** +** ATS is free software; you can redistribute it and/or modify it under +** the terms of the GNU GENERAL PUBLIC LICENSE (GPL) as published by the +** Free Software Foundation; either version 3, or (at your option) any +** later version. +** +** ATS is distributed in the hope that it will be useful, but WITHOUT ANY +** WARRANTY; without even the implied warranty of MERCHANTABILITY or +** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +** for more details. +** +** You should have received a copy of the GNU General Public License +** along with ATS; see the file COPYING. If not, please write to the +** Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA +** 02110-1301, USA. +*) + +(* ****** ****** *) +(* ****** ****** *) +// +(* +Author: Hongwei Xi +Wed Jan 1 03:23:42 PM EST 2025 +Authoremail: gmhwxiATgmailDOTcom +*) +// +(* ****** ****** *) +(* ****** ****** *) +// +(* ****** ****** *)(* ****** ****** *) +(* ****** ****** *)(* ****** ****** *) + +(* end of [ATS3/XANADU_prelude_DATS_CATS_PY_xtop000.dats] *) diff --git a/srcgen2/xats2js/srcgen1/TEST/test01_xats2js.dats b/srcgen2/xats2js/srcgen1/TEST/test01_xats2js.dats new file mode 100644 index 000000000..b09832183 --- /dev/null +++ b/srcgen2/xats2js/srcgen1/TEST/test01_xats2js.dats @@ -0,0 +1,42 @@ +(* ****** ****** *) +(* ****** ****** *) +#staload UN = +"prelude/SATS/unsfx00.sats" +(* ****** ****** *) +(* ****** ****** *) +// +#include +"srcgen1\ +/prelude/HATS/prelude_dats.hats" +// +#include +"srcgen1\ +/prelude/HATS/CATS/JS/prelude_dats.hats" +// +(* ****** ****** *) +(* ****** ****** *) +val N1 = 5 +val N2 = (N1+N1) +val N3 = (N1*N2) +(* ****** ****** *) +(* ****** ****** *) +// +fun +fact1 +(x: sint): sint = +if (x > 0) +then x * fact1(x-1) else 1 +// +(* ****** ****** *) +(* ****** ****** *) +// +(* +val () = +prints("fact1(10) = ", fact1(10), "\n") +val () = console_log(the_print_store_flush()) +*) +// +(* ****** ****** *) +(* ****** ****** *) + +(* end of [ATS3/XANADU_srcgen2_xats2js_srcgen1_TEST_test01_xats2js.dats] *)