Selfhosted source-to-source compiler for a small subset of JavaScript in 1k lines of code.
The prebuilt JS used for bootstrapping is in out/
.
Usage: node cli.js <command|file>
Examples:
node cli.js foo.ms Compile the file ´foo.ms´ into ´foo.js´.
Commands:
self Recompile the compiler.
version Print version information..
help Show this message.
This section is work in progress and doesn't reflect the actual feature set yet!
try {
// try statements
} catch (exception_var) {
// catch statements
} finally {
// finally statements
}
Optional elements:
exception_var
and its surrounding parentheses, resulting incatch {...}
catch
blockfinally
block
import * as import_name from 'import'
export { foo, bar, baz }
This project was inspired by mini-js.
All files in this repository are subject to the MIT License.