Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jison 0.2.2 Error with lstack. #34

Closed
jashkenas opened this issue Mar 20, 2011 · 3 comments
Closed

Jison 0.2.2 Error with lstack. #34

jashkenas opened this issue Mar 20, 2011 · 3 comments

Comments

@jashkenas
Copy link

Hi Zach.

Upgrading from Jison 0.2.0 to 0.2.2 and rebuilding the CoffeeScript compiler causes the generated parser to fail. Looking at the diff, it appears that an lstack array was introduced, into which is pushed two different types of objects: the yyloc location, and the yyval._$ object, which have different properties. The first time the _$ is created, it assumes the existence of a previous object in the stack, causing things to break like so:

TypeError: In Cakefile, Cannot read property 'first_line' of undefined
    at Object.parse (/Users/jashkenas/Desktop/Projects/coffee-script/lib/parser.js:621:63)
    at /Users/jashkenas/Desktop/Projects/coffee-script/lib/coffee-script.js:26:22
    at Object.run (/Users/jashkenas/Desktop/Projects/coffee-script/lib/coffee-script.js:55:28)
    at /Users/jashkenas/Desktop/Projects/coffee-script/lib/cake.js:41:20
    at path.js:271:19

Here's the diff of the generated parser.js:

https://gist.github.com/878709

Hope that helps.

@zaach
Copy link
Owner

zaach commented Mar 21, 2011

Ah, thanks. There was a new location object added to the lexer, but I need to ignore it if a custom lexer does not have it.

@zaach
Copy link
Owner

zaach commented Mar 27, 2011

This should be fixed now.

@zaach zaach closed this as completed Mar 27, 2011
@jashkenas
Copy link
Author

Works great -- thanks for the release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants