Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: empty object and block commenting #54

Open
aaarichter opened this issue Feb 27, 2016 · 1 comment
Open

Bug: empty object and block commenting #54

aaarichter opened this issue Feb 27, 2016 · 1 comment

Comments

@aaarichter
Copy link

There is some sort of bug in the parser when an empty object is set inside a single cson file

works:
empty object normal comment

# test
{}

empty object without block comment

{}

top level object is not empty

###
# test
###
EN: {}

fails:

###
# test
###
{}

Console output

SyntaxError: Syntax error on line 1, column 1: One top level value expected
  at nodeTransforms.Block (/node_modules/cson-parser/lib/parse.js:82:15)
  at transformNode (/node_modules/cson-parser/lib/parse.js:207:12)
  at Object.parse (/node_modules/cson-parser/lib/parse.js:213:12)
@aaarichter aaarichter changed the title Bug: empty object and JSDOC style commenting Bug: empty object and block commenting Feb 27, 2016
@aaarichter
Copy link
Author

The problem seems to be happening in the coffee-script's lexter.tokenizer( ) function at https://github.com/jashkenas/coffeescript/blob/65c35e05a18bef4e302e6fd29c5d0783dd0b8363/src/coffee-script.coffee#L58

I found a workaround that passes the parser:

{
###
# test
###
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant