Implement SplitNTermLevels transform with tests - #14
Open
AlanPietrasz wants to merge 20 commits into
Open
Conversation
ppolesiuk
requested changes
May 18, 2026
ppolesiuk
left a comment
Member
There was a problem hiding this comment.
Thanks! The algorithm looks good. I've found one bug related to handling tag conditions and I have some other minor comments, shown below.
There was a problem hiding this comment.
Pull request overview
Implements the SplitNTermLevels transform (issue #8), which splits each non-terminal into one non-terminal per production-level and inserts forwarding productions that carry tags from the level above. Also adds Level comparison/toString methods, a unit-test suite for the transform, and a minimal bash test runner / harness.
Changes:
- Add
equal,lt,le, andtoStringmethods onLevel. - Implement
Transform/SplitNTermLevels.transform: collect distinct production levels per non-terminal, allocate freshNTermIds per (NTerm, level), rewritePS_NTermsymbols to point at the correct split, and emit forwarding productions between adjacent levels carrying the upper level's tags. - Add
test/TransformTests/SplitNTermLevels.framwith four test cases, plustest/TestAll.fram,test/test_suite, and atest.shbash harness.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Repr/Common/Level.fram | Adds equal/lt/le/toString methods on Level. |
| src/Transform/SplitNTermLevels.fram | Full implementation of the level-splitting transform replacing the prior stub. |
| test/TransformTests/SplitNTermLevels.fram | New unit tests covering NTerm count per level, retention of original productions, forwarding productions, and tag forwarding. |
| test/TestAll.fram | Aggregates test modules; currently imports the new SplitNTermLevels tests. |
| test/test_suite | Declares a framyard_tests suite that runs TestAll.fram with -L src -L test. |
| test.sh | New bash test driver that locates dbl/DBL_LIB, sources a test_suite file, and reports pass/fail counts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
AlanPietrasz
marked this pull request as draft
June 15, 2026 16:12
AlanPietrasz
marked this pull request as ready for review
June 15, 2026 16:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#8
Implemented SplitNTermLevels transform.
Added Level comparison/toString methods.
Added tests for splitting productions by level and forwarding tags/actions.