terraformer-js / terraformer

A geographic toolkit for dealing with geometry, geography, formats, and building geodatabases
MIT License
182 stars 28 forks source link

fix #92 this.parseError is not a function #104

Closed mpalmerlee closed 3 months ago

mpalmerlee commented 3 months ago

By adding a parseError property to the parser.yy object we avoid the error this.parseError is not a function and we can re-throw the underlying error with a more useful error message.

This works because the parser.yy object gets copied to the sharedState object here: https://github.com/zaach/jison/blob/master/lib/jison.js#L1393

Then because sharedState.parseError is defined it is used rather than undefined here: https://github.com/zaach/jison/blob/master/lib/jison.js#L1409

Fixes #92

jgravois commented 3 months ago

thanks for making this contribution @mpalmerlee. i'll make time to take a look at this soon.