Repository navigation
Releases: leafo/mooncoffee
Releases · leafo/mooncoffee
Release list
v1.2.0
First release with language changes that add syntax on top of CoffeeScript 1.12.7.
- Add
const, which declares a block scoped JSconstat the statement site instead of a hoistedvar, with the name still reserved for the whole function at compile time so it can't be redeclared, shadowed, or reassigned - Compile
constdestructuring to native JS destructuring instead of the expanded ES5 form, so defaults apply only toundefinedand array patterns use the iterator protocol, matching CoffeeScript 2 - Report compile errors for reassigning a
const(including+=,++, loop variables, and writes from nested functions), redeclaring a name, usingconstas an expression, and patterns JS destructuring can't express - Add
await, following the CoffeeScript 2 design: there is noasynckeyword, a function whose body containsawaitcompiles toasync function - Support
awaitin bound functions, in comprehensions used as expressions (wrapped in an async IIFE), and asawait return - Report compile errors for
awaitoutside a function, a function mixingyieldandawait, andawaitin a class constructor awaitis now a keyword, so it can no longer be used as a variable name the way it could in CoffeeScript 1.x, property access is emitted asa["await"]like other keywords
Code that uses none of the new syntax still compiles byte-for-byte identical to CoffeeScript 1.12.7.
Full Changelog: v1.1.0...v1.2.0
v1.1.0
- Embed parse tables as generated Go code instead of JSON parsed at startup, CLI startup goes from 15ms to 2ms
- Move the grammar into Go (
internal/parser/grammar.go), one entry per production with its semantic action attached - Add in-repo LALR(1) table generator (
go generate ./internal/parser), Jison and Node are no longer part of the grammar pipeline - Add test verifying the generated automaton is identical to the one upstream shipped
- Replace string token tags with integer enums
- Add hand written scanners for lexer hot paths (numbers, string openers, operators), replacing regexp2
- Token values are now zero copy substrings of the source, tokens are slab allocated
- Disable GC in the CLI since it's a one shot process, soft memory limit keeps large batch invocations bounded
- Report the MoonCoffee version separately from the base CoffeeScript version
Output is still byte-for-byte identical to CoffeeScript 1.12.7.
Full Changelog: v1.0.0...v1.1.0
Initial release
Full Changelog: https://github.com/leafo/mooncoffee/commits/v1.0.0