fix: resolve BashKit parsing and filesystem bugs#30
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
1. Fix echo done bug: Remove terminating word check in argument position. Reserved words like 'done', 'fi', etc. are now only special in command position. The termination of compound commands is handled by parse_compound_list_until which checks for terminators BEFORE parsing. 2. Fix /dev/null redirect: Add /dev directory and /dev/null special handling. Writes to /dev/null are now silently discarded, matching expected behavior. 3. Add tests for echo done, /dev/null redirect, and string concatenation. https://claude.ai/code/session_01Ww87yff3HEPz1GsJKCX4nQ
Add tests to verify that fixes don't break valid behavior: Reserved word handling: - test_done_still_terminates_loop: "done" terminates loops correctly - test_fi_still_terminates_if: "fi" terminates if statements correctly - test_echo_fi_as_argument: "fi" works as an argument - test_echo_then_as_argument: "then" works as an argument - test_reserved_words_in_quotes_are_arguments: quoted reserved words - test_nested_loops_done_keyword: nested loops match done correctly /dev/null handling: - test_dev_null_read_returns_empty: reading returns empty - test_dev_null_append: append mode works - test_dev_null_in_pipeline: works in pipelines - test_dev_null_exists: file exists and is readable https://claude.ai/code/session_01Ww87yff3HEPz1GsJKCX4nQ
5d5fadf to
69de1d8
Compare
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
done,fi,thenare now only special in command position. The termination of compound commands is handled byparse_compound_list_untilwhich checks for terminators BEFORE parsing./devdirectory and/dev/nullspecial handling. Writes to/dev/nullare now silently discarded.Test plan
cargo test- all 277 tests passcargo clippy- no warningscargo fmt --check- properly formatted