CoffeeScriptRedux icon indicating copy to clipboard operation
CoffeeScriptRedux copied to clipboard

Failure to recognize array closing bracket, a few cases

Open sky-dev opened this issue 13 years ago • 2 comments

I'm assuming that coffee-script-redux aims to parse like the original coffeescript compiler on this one. I noticed that certain placements of the closing array bracket do not work in coffee-script-redux that do in the original compiler. Two bug scenarios are below followed by two scenarios where redux behaves appropriately.

Erring scenarios:

test.config(["$routeProvider","$locationProvider", ($routeProvider,$locationProvider) ->
  $routeProvider.otherwise {redirectTo: "/"}
  $locationProvider.html5Mode true])

test.config(["$routeProvider","$locationProvider", ($routeProvider,$locationProvider) ->
  $routeProvider.otherwise {redirectTo: "/"}
  $locationProvider.html5Mode true
  ])

Correctly handled scenarios:

test.config(["$routeProvider","$locationProvider", ($routeProvider,$locationProvider) ->
  $routeProvider.otherwise {redirectTo: "/"}
  $locationProvider.html5Mode true
])

# In original compiler, 'Parse Error on line 4: unexpected 'indent''
test.config(["$routeProvider","$locationProvider", ($routeProvider,$locationProvider) ->
  $routeProvider.otherwise {redirectTo: "/"}
  $locationProvider.html5Mode true
    ])

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

sky-dev avatar Feb 02 '13 06:02 sky-dev

This deviation from the original CS compiler is one of the main issues in updating my codebase to work with coffee-script-redux. I have had to update literally 100+ files just for this issue alone. I do think that fixing this would help the uptake of Redux.

JamesMaroney avatar Feb 03 '13 03:02 JamesMaroney

I think these are similar to some of the problems I'm having... but could you perhaps try to simplify the error cases if at all possible?

ScatteredRay avatar Feb 09 '13 10:02 ScatteredRay