-
Notifications
You must be signed in to change notification settings - Fork 92
Fixing Wrong Generated First Set #157
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
base: master
Are you sure you want to change the base?
Conversation
DmitrySoshnikov
left a comment
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.
MammarDr, thanks for the contribution - glad we have this bug finally caught! Please see comments on the formatting (use tools which should be in this repo for auto-format the code to single style).
4fb389a to
2570278
Compare
c9b247e to
3b6d4fc
Compare
|
@DmitrySoshnikov |
DmitrySoshnikov
left a comment
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.
Thanks @MammarDr - let's stick commit only to logical change and keep formatting for cobase refactorings.
| getTerminalSymbols() { | ||
| if (!this._terminalSymbols) { | ||
| this._terminalSymbols = this.getTerminals().map(symbol => | ||
| this._terminalSymbols = this.getTerminals().map((symbol) => |
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'm not against of any formatting styles (and we can reformat this whole codebase to the latest standard or AI-generated coding), but let's make a separate commit for formatting, and keep this change to its semantics.
|
@DmitrySoshnikov (not doing it all in one go will complicate the code and maybe become less efficient) |
Issue #138
Hi this is my first github contribution and i feel honored to be help to you as you were to me in your amazing courses.
1-
I fixed the wrong generated first sets from productions that have the nullable LHS(derive ε) appear in firstOf(rhs).
the solution is to register the Non-Terminals that derive epsilon directly (A->ε) before calculating the first sets.
added test case for this issue.
2-
i also spotted a function typo 'getOrignialSymbol' -> 'getOriginalSymbol'