Closed magicant closed 2 months ago
[!IMPORTANT]
Review skipped
Draft detected.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yaml
file in this repository. To trigger a single review, invoke the@coderabbitai review
command.You can disable this status message by setting the
reviews.review_status
tofalse
in the CodeRabbit configuration file.
The updates across the yash
project introduce crucial changes like replacing ReadEvalLoop
with the read_eval_loop
function, utilizing RefCell
for mutable state management, and restructuring various modules to enhance code readability and organization. There's also an emphasis on modernizing the code by adopting new traits and deprecating outdated methods. These changes improve the flexibility and maintainability of the codebase, particularly affecting alias handling and input processing.
Files and Changes |
---|
yash-builtin/src/eval.rs , yash-semantics/src/trap.rs , yash-semantics/src/lib.rs , etc. |
- Replaced ReadEvalLoop with read_eval_loop , added RefCell , and updated related methods. |
yash-cli/CHANGELOG.md , yash-cli/src/lib.rs |
- Updated first argument of startup::prepare_input to use RefCell . Changed SourceInput::verbose handling. |
yash-env/CHANGELOG.md , yash-env/src/alias.rs , yash-env/src/input.rs , etc. |
- Added Glossary trait, input::Echo , deprecated FdReader::set_echo , moved FdReader implementation. |
yash-semantics/CHANGELOG.md , yash-semantics/src/runner.rs , yash-semantics/src/runner_legacy.rs , etc. |
- Added read_eval_loop replacing ReadEvalLoop , introduced runner_legacy . Deprecated ReadEvalLoop::set_verbose . |
yash-syntax/CHANGELOG.md , yash-syntax/src/alias.rs , yash-syntax/src/input.rs , etc. |
- Introduced Glossary trait, replaced AliasSet , deprecated old methods, and updated tests. |
Sequence Diagram(s)
sequenceDiagram
participant CLI
participant Env
participant Lexer
participant EvalLoop
CLI->>Env: RefCell<&mut Env>
CLI->>Lexer: &mut Lexer
CLI->>EvalLoop: Call read_eval_loop with RefCell<&mut Env>, &mut Lexer
EvalLoop->>Lexer: Execute
EvalLoop->>Env: Modify and update environment
EvalLoop-->>CLI: Return results
ππΌ
Beneath the code, new threads were spun, With
RefCell
s shining in the sun.Glossary
whispered aliases true, Echo carried your commands through. Out with the old, in with the new, Yash's heart beats bright and blue.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
This is the preparatory part of #372.
Parser
Parser::aliases
's typeFdReader
to a newInput
decorator.FdReader::set_echo
read_eval_loop
functionReadEvalLoop
with calls to theread_eval_loop
functionReadEvalLoop
Summary by CodeRabbit
New Features
input::Echo
, a decorator for enhanced verbose shell behavior.Glossary
trait for alias management in the environment, with methods to look up and check if the alias list is empty.Refactor
ReadEvalLoop
withread_eval_loop
function for improved async handling and code readability.FdReader
implementation into its own module for better code organization.EmptyGlossary
instead ofAliasSet
, enhancing modularity and maintainability.Deprecations
ReadEvalLoop::set_verbose
in favor of usinginput::Echo
.Bug Fixes
yash-env
module.Dependency Updates