coffeescript-eclipse icon indicating copy to clipboard operation
coffeescript-eclipse copied to clipboard

Syntax errors on arrays of objects

Open giacecco opened this issue 12 years ago • 1 comments

Coffeescript code like this:

arrayOfObjects = [
    'object1property1': "foo"
    'object1property2': "bar"
  ,
    'object2property1': "foo"
    'object2property2': 
      'object2property2subproperty1': "ba"
      'object2property2subproperty2': "r"
]

triggers strange syntax errors. On the comma I get

mismatched input ',' expecting RULE_RBRACKET

On the "object2property2" and "object2property2subproperty2" lines I get:

no viable alternative at input ':'

Is it the same problem as deeply nested properties described here? Thanks.

giacecco avatar Nov 10 '12 12:11 giacecco

I am also getting a similar problem with a line like this :

collections.campaign[@campaignID].leadsDialable += rows[0].num

The += has the error of "no viable alternative at input '+=' " And the rows[ has the error of " missing RULE_OUTDENT at '[' "

Hope this helps. Id love to be able to edit coffeescript from inside eclipse but as it stands im having to use sublime :(

devdandev avatar May 21 '13 15:05 devdandev