From 45669e08c6bbfd5c9631e4b393b30abaffcdf272 Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Wed, 12 May 2010 21:49:46 -0400 Subject: [PATCH] better indentation handling for far-left heredocs and herecomments --- lib/nodes.js | 2 +- src/nodes.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/nodes.js b/lib/nodes.js index 9dbbdd92..3fae39d0 100644 --- a/lib/nodes.js +++ b/lib/nodes.js @@ -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 + "//")); diff --git a/src/nodes.coffee b/src/nodes.coffee index ed873b9f..9ece3853 100644 --- a/src/nodes.coffee +++ b/src/nodes.coffee @@ -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//")