-
-
Notifications
You must be signed in to change notification settings - Fork 32k
d_initial is not used by the parser, so no point generating it #12212
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think is better to pass the index of the start symbol into the list of dfas down to the grammar and use that when generating the parser input files.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Could you please clarify? |
Yup, make pgen generate it from the position of the initial symbol. The initial dfa symbol is placed in the grammar in: The value has to be the position of that symbol in the list of dfas. It will be 0 as change: "0, {n_states}, states_{dfa_index},\n".format( to start_index = list(self.dfas.keys()).index(self.start)
"{start}, {n_states}, states_{dfa_index},\n".format(start=start_index |
Now I see what you mean, but |
Oh, right! Sorry, I have mistaken this with the start rule in the old pgen: Line 658 in 79fbcc5
But as you indicate, d_initial has been initialized always to 0: Line 642 in 79fbcc5
|
@tyomitch Can you rebase to regenerate the |
Done! |
Thanks @tyomitch for the contribution! :) |
No description provided.