1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00

[CS2] return and export default can now accept implicit objects (#4532)

* Start with the test I want to pass: return an implicit (braces-less) object

* Update Rewriter class to follow pattern of nodes.coffee; move debugging snippet to where it’ll work in CS2

* Allow export default implicit object

* `return` assumes a continuation onto the next line *if* the next line is indented

* Fix comment; improve test
This commit is contained in:
Geoffrey Booth 2017-05-01 19:26:24 -07:00 committed by GitHub
parent 3e70d31e5d
commit 2f9ab1d328
7 changed files with 45 additions and 14 deletions

View file

@ -1,6 +1,6 @@
// Generated by CoffeeScript 2.0.0-beta1
(function() {
var BALANCED_PAIRS, CALL_CLOSERS, EXPRESSION_CLOSE, EXPRESSION_END, EXPRESSION_START, IMPLICIT_CALL, IMPLICIT_END, IMPLICIT_FUNC, IMPLICIT_UNSPACED_CALL, INVERSES, LINEBREAKS, SINGLE_CLOSERS, SINGLE_LINERS, generate, k, left, len, rite,
var BALANCED_PAIRS, CALL_CLOSERS, EXPRESSION_CLOSE, EXPRESSION_END, EXPRESSION_START, IMPLICIT_CALL, IMPLICIT_END, IMPLICIT_FUNC, IMPLICIT_UNSPACED_CALL, INVERSES, LINEBREAKS, Rewriter, SINGLE_CLOSERS, SINGLE_LINERS, generate, k, left, len, rite,
indexOf = [].indexOf;
generate = function(tag, value, origin) {
@ -13,7 +13,7 @@
return tok;
};
exports.Rewriter = (function() {
exports.Rewriter = Rewriter = (function() {
class Rewriter {
rewrite(tokens1) {
this.tokens = tokens1;