bevry / cson

CoffeeScript-Object-Notation. Same as JSON but for CoffeeScript objects.
Other
1.34k stars 55 forks source link

Error with 0 decimals #56

Closed Calvein closed 7 years ago

Calvein commented 9 years ago

I'm not sure how to actually call them but I'm talking about number like this 0.4. We have to put a 0 before the . or it returns an empty object (in the cli).

# in.cson
test: 0.2
# out.json
{
  "test": 0.2
}
# in.cson
test: .2
# out.json
{}
pflannery commented 9 years ago

It seems JSON.parse has a similar scenario expect it doesn't return {}

JSON.parse('{"test": .1}') // Gives (program):1 Uncaught SyntaxError: Unexpected token .

JSON.parse('{"test": 0.1}') // Gives Object {test: 0.1}
balupton commented 7 years ago

Probably due to https://github.com/bevry/cson/issues/78

balupton commented 7 years ago

closed with v4.1.0