🎨 Improve edge cases in path handling#139
Merged
Merged
Conversation
Problem: - Aside from literals, there isn't an easy way to make a path from a ct_string. - `root` and `without_root` don't handle edge cases of paths being singleton/empty. - There is no function to get the "parent" of a path. Solution: - Expose `make_path`. - Handle edge cases in `root` and `without_root` functions. - Add `parent`. Note: - `root` and `without_root` are primarily used in path resolution, and manipulate the topmost element. - `parent` is analogous to "go up a directory" and is useful for e.g. getting a register, given a field.
mjcaisse-intel
approved these changes
Feb 3, 2026
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.
Problem:
rootandwithout_rootdon't handle edge cases of paths being singleton/empty.Solution:
make_path.rootandwithout_rootfunctions.parent.Note:
rootandwithout_rootare primarily used in path resolution, and manipulate the topmost element.parentis analogous to "go up a directory" and is useful for e.g. getting a register, given a field.