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:
parent
6608a7aa98
commit
35a30fbd6d
2 changed files with 6 additions and 4 deletions
|
@ -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);
|
||||
|
|
|
@ -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+$/, ''
|
||||
|
|
Loading…
Reference in a new issue