zaach / jison

Bison in JavaScript.
http://jison.org
4.35k stars 449 forks source link

Jison 0.4.14+ broke CoffeeScript parser #243

Open davidbau opened 10 years ago

davidbau commented 10 years ago

Jison 4.14 breaks CoffeeScript. Works perfectly fine if downgraded to 4.13. It looks like maybe the interface to Jison changed in some subtle way, with parser state that used to be accessible now submerged into an inaccessible sharedState object?

To repro:

git clone https://github.com/jashkenas/coffeescript
cd coffeescript
npm install
bin/cake build:parser
bin/cake build:full

Observe "cannot read property 0 of undefined" errors when CoffeeScript is assuming that it can read error position information out of a shared state object, but it can't:

failed 6 and passed 581 tests in 2.19 seconds

parser error formating AssertionError: Expected [stdin]:1:15: error: unexpected in foo in bar or in baz ^^ to equal TypeError: Cannot read property '0' of undefined at global.eq (/home/davidbau/git/dabbler-coffeescript/Cakefile:312:14) at Object. (/home/davidbau/git/dabbler-coffeescript/test/error_messages.coffee:10:5) at expectedException (assert.js:275:23) at _throws (assert.js:308:8) at assert.throws (assert.js:317:11) at assertErrorFormat (/home/davidbau/git/dabbler-coffeescript/test/error_messages.coffee:8:3) at Function. (/home/davidbau/git/dabbler-coffeescript/test/error_messages.coffee:25:3) at global.test (/home/davidbau/git/dabbler-coffeescript/Cakefile:275:12) at Object. (/home/davidbau/git/dabbler-coffeescript/test/error_messages.coffee:24:1) at Object. (/home/davidbau/git/dabbler-coffeescript/test/error_messages.coffee:7:1) at Module._compile (module.js:456:26)

zaach commented 10 years ago

I'll investigate.

lydell commented 9 years ago

As far as I can tell this was introduced in https://github.com/zaach/jison/commit/3548861b314df7e119fd8d60b1b714b00b76a24a.

lydell commented 9 years ago

IMO this isn’t jison’s fault, but CoffeeScript’s. See jashkenas/coffeescript#3794. If you don’t agree, at least the cause is known now.