Trying to compile the recently introduced Tetris, I got this:
/home/yannick/apps/ats/lib/ats2-postiats-0.1.11/bin/atscc2js -o
tetris_dats.js -i tetris_dats.c
Hello from atscc2js!
ParsingErrors:
: 24(line=3, offs=1) – 30(line=3, offs=7): error(parsing): the keyword
[EOF] is needed.
exit(ATS): uncaught exception at run-time:
/home/yannick/Applications/Third_Parties/ATS/ATSCC2JS/catsparse.sats:FatalErrorExn(1024)
make: *** [tetris_dats.js] Erreur 1
The test file is just the Hello-word from the ATS site:
http://www.ats-lang.org/Patsoptaas.html . Saved as test.dats
and running
patsopt -d test.dats | atscc2js -o test_dats.js
, I get this:
Hello from atscc2js!
[…]/libatscc/DATS/list.dats: 4029(line=271, offs=5) – 4033(line=271,
offs=9): error(parsing): the syntactic entity [p0at] is needed.
[…]/libatscc/DATS/list.dats: 4025(line=271, offs=1) – 4028(line=271,
offs=4): error(parsing): the keyword [in] is needed.
[…]/libatscc/DATS/list.dats: 4018(line=269, offs=6) – 4021(line=269,
offs=9): error(parsing): the syntactic entity [d0exp] is needed.
[…]/libatscc/DATS/list.dats: 4002(line=267, offs=1) – 4004(line=267,
offs=3): error(parsing): the keyword [end] is needed.
[…]/libatscc/DATS/list.dats: 3959(line=261, offs=13) – 3962(line=261,
offs=16): error(parsing): the syntactic entity [d0exp] is needed.
[…]/libatscc/DATS/list.dats: 3922(line=259, offs=1) – 3931(line=259,
offs=10): error(parsing): the token is discarded.
exit(ATS): uncaught exception:
_2home_2hwxi_2research_2Postiats_2git_2src_2pats_error_2esats__FatalErrorExn(1025)
I don’t know what’s wrong with my installation, as it works online.Le samedi 9 mai 2015 18:39:09 UTC+2, gmhwxi a écrit :
If I could take a look at the file test.dats you used, I may be able to
see what the cause was.
Basically, you need the following two lines to tell the ATS compiler
(patsopt) how to handle
templates for the purpose of generating JS code:
//
#include “share/atspre_define.hats”
#include “{$LIBATSCC2JS}/staloadall.hats”
//
On Sat, May 9, 2015 at 12:06 PM, ‘Yannick Duchêne’ via ats-lang-users < ats-l...@googlegroups.com <javascript:>> wrote:
This thread may be the opportunity for a basic question: what’s the
recommended path to get a working atscc2js?
I installed ATS/Postiats 0.1.11, compiled astcc2js with it, but running
patsopt -d test.dats | atscc2js -o test_dats.js
I either get an error
about a missing (not available for staloading) STATS/option.sats
if I use
the libatscc2js from contrib from SourceForge or syntax errors (“the
syntactic entity [xyz] is needed”) if I use the libatscc2js from contrib
from GitHub.
I wanted to test if ATS typing can help me with maintenance issues I have
with some JavaScript.
Le dimanche 3 mai 2015 00:39:14 UTC+2, gmhwxi a écrit :
Here is an implementation of Tetris in ATS+Bacon.js:
https://github.com/githwxi/ATS-Postiats-contrib/tree/master/projects/SMALL/JSmygame/Tetris
The graphics for the game uses easel.js by createjs.
There is clearly a lot of room for improvement. Part of my purpose for
writing the game was to test atscc2js, the compiler for translating into
JavaScript the C output from ATS source. I myself find ATS+JavaScript
co-programming to be very interesting.
If you want to play with it:
Index of /COMPILED/doc/PROJECT/SMALL/JSmygame/Tetris
Please help improve it (and have fun!).
Cheers!
–Hongwei
–
You received this message because you are subscribed to the Google Groups
“ats-lang-users” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to ats-lang...@googlegroups.com <javascript:>.
To post to this group, send email to ats-l...@googlegroups.com
<javascript:>.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/10db92af-cee9-46e9-8d1e-74e79b4ba33d%40googlegroups.com
https://groups.google.com/d/msgid/ats-lang-users/10db92af-cee9-46e9-8d1e-74e79b4ba33d%40googlegroups.com?utm_medium=email&utm_source=footer
.