zaach / jison

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

parser.yy not properly initialized after jison upgrade. #263

Open mainmanmauricio opened 9 years ago

mainmanmauricio commented 9 years ago

Hi,

after upgrading jison my parser was broken. Specifically yy.foo() calls did not work any more. The following patch made it work again.

1387,1392d1386 < // copy state < for (var k in this.yy) { < if (Object.prototype.hasOwnProperty.call(this.yy, k)) { < sharedState.yy[k] = this.yy[k]; < } < } 1393a1388,1390

if (this.yy)
  sharedState = Object.create(this.yy);

I do not know if the above is the correct fix but hopefully the diff is of value to you.

Cheers, Maurice