--compilation_level ADVANCED --language_in ECMASCRIPT5_STRICT -language_out ECMASCRIPT5_STRICT --warning_level VERBOSE
/**
* @preserve JavaScript generated
* from [ATS (Applied Type system)](http://www.ats-lang.org) source
* then minified using [Closure](http://developers.google.com/closure/).
*/
Just wanted to mention Closure which may be worth used on ATS generated JavaScript, for two reasons:* It support inlining, which is welcome for function wrapping JavaScript expressions (ex from `bool.sats` and others);* It can be invoked so that it checks for missing references, which is welcome as there is otherwise no compilation phase as with the C target, to be sure to be hinted about undefined references.
Thanks.
I also did a bit investigation on Closure last night.
Here is a simple procedure that formed in my mind:
Say I have a project called myproject. I do ATS+JS co-programming.
At the end I produce a single file myproject.js. Then I will use Closure
to compile myproject.js+libatscc2js_all.js together to generate another file
myproject_final.js, which is the final output of myproject.
I get libatscc2js_all.js from https://gist.github.com/githwxi/c754d1fbea087ffb9e93 , as this was part of my installation (don't know if I once again something wrong).
I will look into the issue of tmplab ad tmplab_js. Maybe you could show me
a file where you had to manually add things like 'var tmplab' and 'var tmplab_js'.
#include "share/atspre_define.hats"
#include "{$LIBATSCC2JS}/staloadall.hats"
#define ATS_MAINATSFLAG 1
#define ATS_DYNLOADNAME "js_main_dynload"
%{$
js_main_dynload()
%}
./libatscc2js_all.js:1400: ERROR - variable tmplab_js is undeclared
tmplab_js = 1;
^
./libatscc2js_all.js:1402: ERROR - variable tmplab is undeclared
tmplab = tmplab_js; tmplab_js = 0;
^
2 error(s), 0 warning(s)
*** Exited with status 2 ***
Thanks!
%{^
/**
* @preserve JavaScript generated
* from [ATS (Applied Type System)](http://www.ats-lang.org) source
* then minified using [Closure](http://developers.google.com/closure/).
*/
%}
// COMMENT_line