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

cleaned up block comment output; fixes #1186

This commit is contained in:
Michael Ficarra 2011-08-07 03:51:51 -04:00
parent 6608a7aa98
commit 35a30fbd6d
2 changed files with 6 additions and 4 deletions

View file

@ -495,7 +495,7 @@
Comment.prototype.makeReturn = THIS;
Comment.prototype.compileNode = function(o, level) {
var code;
code = '/*' + multident(this.comment, this.tab) + '*/';
code = '/*' + multident(this.comment, this.tab) + ("\n" + this.tab + "*/\n");
if ((level || o.level) === LEVEL_TOP) code = o.indent + code;
return code;
};
@ -1999,6 +1999,7 @@
return ref;
};
multident = function(code, tab) {
return code.replace(/\n/g, '$&' + tab);
code = code.replace(/\n/g, '$&' + tab);
return code.replace(/\s+$/, '');
};
}).call(this);

View file

@ -441,7 +441,7 @@ exports.Comment = class Comment extends Base
makeReturn: THIS
compileNode: (o, level) ->
code = '/*' + multident(@comment, @tab) + '*/'
code = '/*' + multident(@comment, @tab) + "\n#{@tab}*/\n"
code = o.indent + code if (level or o.level) is LEVEL_TOP
code
@ -1851,4 +1851,5 @@ utility = (name) ->
ref
multident = (code, tab) ->
code.replace /\n/g, '$&' + tab
code = code.replace /\n/g, '$&' + tab
code.replace /\s+$/, ''