better indentation handling for far-left heredocs and herecomments

This commit is contained in:
Jeremy Ashkenas 2010-05-12 21:49:46 -04:00
parent a5db69e1af
commit 45669e08c6
2 changed files with 2 additions and 2 deletions

View File

@ -523,7 +523,7 @@
CommentNode.prototype.compile_node = function compile_node(o) {
var sep;
if (this.type === 'herecomment') {
sep = '\n' + this.idt(1);
sep = '\n' + this.tab;
return "" + this.tab + "/*" + sep + (this.lines.join(sep)) + "\n" + this.tab + "*/";
} else {
return ("" + this.tab + "//") + this.lines.join(("\n" + this.tab + "//"));

View File

@ -368,7 +368,7 @@ exports.CommentNode: class CommentNode extends BaseNode
compile_node: (o) ->
if @type is 'herecomment'
sep: '\n' + @idt(1)
sep: '\n' + @tab
"$@tab/*$sep${ @lines.join(sep) }\n$@tab*/"
else
"$@tab//" + @lines.join("\n$@tab//")