feat: associative arrays, chown/kill builtins, array slicing tests#236
Merged
feat: associative arrays, chown/kill builtins, array slicing tests#236
Conversation
- Implement associative arrays (declare -A): key-value access,
iteration with ${!m[@]}, ${#m[@]}, unset element, variable keys
- Add chown builtin (no-op in VFS, validates file existence, -R flag)
- Add kill builtin (no-op in VFS, -l lists signals)
- Handle unset for array elements at interpreter level
- Fix expand_word_to_fields for assoc array @/* and ArrayIndices
- Add 27 new tests: 12 assoc-arrays, 8 array-slicing, 7 chown-kill
- Update specs: 95 builtins, 711 bash tests (705 pass, 6 skip)
https://claude.ai/code/session_012rzB3FRw7yoQWCG1mxyW7J
- Add ASCII guard in parse_arithmetic_impl to prevent byte/char index mismatch
- Use char-based indexing in Substring expansion for correct multi-byte handling
- Add regression test for multi-byte chars in variable expansion
- Fixes proptest failure: "${:¡%}" caused byte boundary panic
https://claude.ai/code/session_012rzB3FRw7yoQWCG1mxyW7J
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.
Summary
declare -A): key-value access, iteration with${!m[@]},${#m[@]}, unset element, variable keyschownbuiltin (no-op in VFS, validates file existence,-Rflag)killbuiltin (no-op in VFS,-llists signals)unsetfor array elements at interpreter level (both indexed and assoc)expand_word_to_fieldsto produce separate fields for assoc array@/*andArrayIndicesTest plan
cargo test --all-featurespasses (all 14 test suites)cargo clippy --all-targets --all-features -- -D warningscleancargo fmt --checkclean