mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-19 03:44:23 -05:00
better indentation handling for far-left heredocs and herecomments
This commit is contained in:
@@ -523,7 +523,7 @@
|
|||||||
CommentNode.prototype.compile_node = function compile_node(o) {
|
CommentNode.prototype.compile_node = function compile_node(o) {
|
||||||
var sep;
|
var sep;
|
||||||
if (this.type === 'herecomment') {
|
if (this.type === 'herecomment') {
|
||||||
sep = '\n' + this.idt(1);
|
sep = '\n' + this.tab;
|
||||||
return "" + this.tab + "/*" + sep + (this.lines.join(sep)) + "\n" + this.tab + "*/";
|
return "" + this.tab + "/*" + sep + (this.lines.join(sep)) + "\n" + this.tab + "*/";
|
||||||
} else {
|
} else {
|
||||||
return ("" + this.tab + "//") + this.lines.join(("\n" + this.tab + "//"));
|
return ("" + this.tab + "//") + this.lines.join(("\n" + this.tab + "//"));
|
||||||
|
|||||||
@@ -368,7 +368,7 @@ exports.CommentNode: class CommentNode extends BaseNode
|
|||||||
|
|
||||||
compile_node: (o) ->
|
compile_node: (o) ->
|
||||||
if @type is 'herecomment'
|
if @type is 'herecomment'
|
||||||
sep: '\n' + @idt(1)
|
sep: '\n' + @tab
|
||||||
"$@tab/*$sep${ @lines.join(sep) }\n$@tab*/"
|
"$@tab/*$sep${ @lines.join(sep) }\n$@tab*/"
|
||||||
else
|
else
|
||||||
"$@tab//" + @lines.join("\n$@tab//")
|
"$@tab//" + @lines.join("\n$@tab//")
|
||||||
|
|||||||
Reference in New Issue
Block a user