Refactor: Move Ifs, Ranges, and Class from yash-semantics to yash-env
#637
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.
This PR refactors the field splitting components by moving them from
yash_semantics::expansion::splittoyash_env::expansion::split, making these utilities available to other parts of the codebase without depending on the heavieryash-semanticscrate.What was moved
The following items have been relocated to
yash-env:New
expansionmodule in yash-envexpansion::attrAttrChar: Character with attributes describing its originOrigin: Category of syntactic elements from which expansion originatesexpansion::attr_stripStriptrait for performing attribute strippingIter: Iterator wrapper for attribute strippingAttrCharand iteratorsexpansion::splitClass: Type of characters that affect field splittingIfs: Collection of input field separator charactersRanges: Iterator that yields index ranges of separated fieldsBackward compatibility
All moved items are re-exported from their original locations in
yash-semantics, ensuring complete backward compatibility. Existing code using these types throughyash-semanticswill continue to work without any changes:Rationale
Moving these components to
yash-envprovides several benefits:yash-semanticsVersion updates
0.9.2→0.10.0(minor bump for new public API additions)0.10.1→0.10.2(patch bump for internal refactoring with re-exports)Testing
./check.shpassedOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.