Releases: dk00/livescript-next
Releases · dk00/livescript-next
0.0.4
Implement Original LS Feature
- Bare splat call(super)
a .... - Singed modulo operator
a %% b. - Named destructing with named top structure
{a}: b = c. - Named destructing with names in deeply nested structure
{a: {{b}: c}} = d. - Object literals and substructures with default values
a{b, c=d}.
🐛 Bug Fix
- Bit shift operators
.<<..>>..>>>.. - Convert forward function composing
a >> b. - Slicing with chains
a b .[c to]. - Named destructing in function parameters, with default value.
💅 Improvement
- Errors are reported with source location.
- Add source locations for generated and transformed nodes.
- Optimize literal property copying:
a <<< {b, c: d}is compiled to[a.b, a.c] = [b, d], a. - Assignment result variables is reused when caching is required.
- Partial applied operators are converted to arrow functions.
- Function blocks are expanded before auto returning, to avoid additional do block at end of functions.
- Literal property names are converted without computed flag.
0.0.3
Variable Scope
Variables are declared at beginning of function blocks, like original LS(instead of beginning of blocks).
Conversion of Existing Features
- Named destructing
{{x}: y} = zfor assignments and function parameters. - List/Object comprehensions.
- Function composing operator
a . b<<>>. - Unary
dooperator(do ->call function in place, without arguments). ofoperator: convert toininoperator: convert toa.includes b
Improvements
- Bound function
~>is converted to arrow function=>. - Binary expressions with
<<++<?>?<<<are merged with same type. - Output of
export \lib : nameis changed fromexport { default as name } from "lib"toexport name from "lib".
0.0.2
Async and Await
Calls to await are converted to await expressions, also implicitly make the containing function async.
-> await something
function named
await func args(async function () {
return await something;
});
async function named() {
return await func(args);
}Conversion of Existing Features
newoperatornew Anew A b, c- Object/Array slicing & substructuring
a{b, c}a[b, c] - Binding property access
a~bis converted to bind operator::a.b - Partial application to operators
(a +)(+ a) - Allow suppressing automatic returning
!->!function
Improvements
- Conversion of cascade is moved to LS node transform, and no more uses additional cache variables for nested cascade
- Conversion of switch statements are also moved to LS node transform, added source locations, should result better source maps and coverage support.
0.0.1
The convert function is self-hosting, it generates identical result with itself, and passes all test.
Implemented features:
import/export- Functions,
return - Chain: property access, function call
- JS operators
- Assignment and destructuring*
if/elsestatement- Literals
- Cascade
.. switch/casestatement*try/throw/catch/finally*
Things might be different:
- Block scope: every variable are declare at beginning of block.
- Result of statements are handled by
doexpressions, but the current babel implementation is buggy.trystatements might not return result properly, andswitchstatements are converted to?:expressions, sofallthroughis not supported at this time.