mcrowe / soulmate.js

A jQuery front-end for the soulmate auto-suggestion gem
MIT License
121 stars 18 forks source link

Compilation fail #3

Closed lou closed 12 years ago

lou commented 12 years ago

When I try to compile jquery.soulmate.coffee I got this error:

Error: In jquery.soulmate.coffee, Parse error on line 165: Unexpected 'POST_IF'
    at Object.parseError (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/parser.js:470:11)
    at Object.parse (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/parser.js:546:22)
    at Object.compile (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:40:22)
    at /usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:140:33
    at /usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:110:18
    at [object Object].<anonymous> (fs.js:114:5)
    at [object Object].emit (events.js:64:17)
    at afterRead (fs.js:1081:12)
    at Object.wrapper [as oncomplete] (fs.js:252:17)

It may be related to the version of coffee-script I use (CoffeeScript version 1.2.0).

Thanks for your nice lib @mcrowe

mcrowe commented 12 years ago

Hi lou,

Thanks for posting this issue. Unfortunately, I'm not able to re-produce it in either version 1.2.0 or 1.1.2, though, and the code around line 165 looks pretty innocent to me.

Do you have any more details that could help debug or re-produce this? My only thought is that indentation might be inconsistent between our editors and that's causing parse errors. You can always try the brute force method and comment out code until the thing parses, and find the guilty lines.

Hope I can help somehow.

Cheers, Mitch

mcrowe commented 12 years ago

I'm going to close this issue 'cause I didn't hear back from you and I don't know how to recreate the problem. I'd be happy to look into this more if you want it re-opened.

LilMuddy commented 12 years ago

I was able to replicate the issue and found that it was due to an indentation error caused by mixed use of space and tab characters. Does the parser detect mixed indentation in if syntax?

mcrowe commented 12 years ago

Hi LilMuddy. Thanks for reporting! I still can't reproduce this, and didn't see any mixed space / tabs around that line.

Could you let me know what version of coffeescript you used, and maybe let me know exactly what line/column is causing the issue if you can figure that out. This would be a big help.