mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-01-14 01:07:55 -05:00
fixes #2037: line terminators are incorrectly added after herecomments
thanks @geraldalewis for finding the relevant line and making this fix way too easy for me
This commit is contained in:
@@ -171,7 +171,6 @@
|
||||
herecomment: true,
|
||||
indent: Array(this.indent + 1).join(' ')
|
||||
}));
|
||||
this.token('TERMINATOR', '\n');
|
||||
}
|
||||
this.line += count(comment, '\n');
|
||||
return comment.length;
|
||||
|
||||
@@ -654,7 +654,7 @@
|
||||
|
||||
Comment.prototype.compileNode = function(o, level) {
|
||||
var code;
|
||||
code = '/*' + multident(this.comment, this.tab) + ("\n" + this.tab + "*/");
|
||||
code = '/*' + multident(this.comment, this.tab) + ("\n" + this.tab + "*/\n");
|
||||
if ((level || o.level) === LEVEL_TOP) code = o.indent + code;
|
||||
return code;
|
||||
};
|
||||
|
||||
@@ -178,7 +178,6 @@ exports.Lexer = class Lexer
|
||||
if here
|
||||
@token 'HERECOMMENT', @sanitizeHeredoc here,
|
||||
herecomment: true, indent: Array(@indent + 1).join(' ')
|
||||
@token 'TERMINATOR', '\n'
|
||||
@line += count comment, '\n'
|
||||
comment.length
|
||||
|
||||
|
||||
@@ -468,7 +468,7 @@ exports.Comment = class Comment extends Base
|
||||
makeReturn: THIS
|
||||
|
||||
compileNode: (o, level) ->
|
||||
code = '/*' + multident(@comment, @tab) + "\n#{@tab}*/"
|
||||
code = '/*' + multident(@comment, @tab) + "\n#{@tab}*/\n"
|
||||
code = o.indent + code if (level or o.level) is LEVEL_TOP
|
||||
code
|
||||
|
||||
|
||||
Reference in New Issue
Block a user