Skip to content

Commit

Permalink
Add tests for bug jashkenas#4290, fail to make them pass
Browse files Browse the repository at this point in the history
  • Loading branch information
rdeforest committed Dec 5, 2016
1 parent 67b025e commit 336f1bf
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/coffee-script/command.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/coffee-script/grammar.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/grammar.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ grammar =
# The list of parameters that a function accepts can be of any length.
ParamList: [
o '', -> []
o 'Comment'
o 'Param', -> [$1]
o 'ParamList , Param', -> $1.concat $3
o 'ParamList OptComma TERMINATOR Param', -> $1.concat $4
Expand Down Expand Up @@ -477,6 +478,7 @@ grammar =
# (i.e. comma-separated expressions). Newlines work as well.
ArgList: [
o 'Arg', -> [$1]
o 'Comment' -> []
o 'ArgList , Arg', -> $1.concat $3
o 'ArgList OptComma TERMINATOR Arg', -> $1.concat $4
o 'INDENT ArgList OptComma OUTDENT', -> $2
Expand Down
9 changes: 9 additions & 0 deletions test/comments.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -431,3 +431,12 @@ test "#3761: Multiline comment at end of an object", ->
test "#4375: UTF-8 characters in comments", ->
# 智に働けば角が立つ、情に掉させば流される。
ok yes

test "#4290: Block comment in array", ->
anArray = [ ### ### ]

test "#4290: Block comment in function call args", ->
-> fn( ### ### )

test "#4290: Block comment in function expression params", ->
fn = ( ### ### ) ->

0 comments on commit 336f1bf

Please sign in to comment.