Adding initial implementation of here-comments (block comments) Issue #368

This commit is contained in:
Jeremy Ashkenas
2010-05-12 20:56:44 -04:00
parent 7e3c71ed19
commit 8aceef20e1
8 changed files with 252 additions and 212 deletions

View File

@@ -358,15 +358,20 @@ children ValueNode, 'base', 'properties'
# same position.
exports.CommentNode: class CommentNode extends BaseNode
constructor: (lines) ->
constructor: (lines, type) ->
@lines: lines
@type: type
this
make_return: ->
this
compile_node: (o) ->
"$@tab//" + @lines.join("\n$@tab//")
if @type is 'herecomment'
sep: '\n' + @idt(1)
"$@tab/*$sep${ @lines.join(sep) }\n$@tab*/"
else
"$@tab//" + @lines.join("\n$@tab//")
statement CommentNode