Fixing Wrong Generated First Set#157
Fixing Wrong Generated First Set#157MammarDr wants to merge 3 commits intoDmitrySoshnikov:masterfrom
Conversation
DmitrySoshnikov
left a comment
There was a problem hiding this comment.
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.
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.
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'