Closed magicant closed 2 months ago
The recent updates introduce structural changes to parameter handling across multiple modules in the yash
project. The modifications primarily focus on enhancing error messages, refactoring parameter expansion logic, and adopting a new Param
struct for consistency and improved readability. Key components affected include error handling, parameter expansion, and syntax parsing.
Files/Modules | Change Summary |
---|---|
yash-cli/CHANGELOG-bin.md |
Updated to reflect new changes in parameter handling and improved error messages. |
yash-semantics/CHANGELOG.md |
Documented changes in parameter error handling with Param struct, enum updates, and dependency updates. |
yash-semantics/src/expansion.rs |
Imported Param , updated UnsetParameter error handling to use param , and adjusted error message formatting. |
yash-semantics/src/expansion/initial/arith.rs |
Replaced name with param in UnsetVariable struct and updated related function references. |
yash-semantics/src/expansion/initial/param.rs |
Introduced BracedParam , modified ParamRef to use BracedParam , and updated function calls and methods accordingly. |
yash-semantics/src/expansion/initial/param/resolve.rs |
Modified resolve function to take param instead of name and updated parameter name resolution logic. |
yash-semantics/src/expansion/initial/param/switch.rs |
Updated error handling, function signatures, and parameter type checks to use Param struct. |
yash-semantics/src/expansion/initial/text.rs |
Adjusted RawParam to use param and updated test cases to reflect new parameter handling logic. |
yash-semantics/src/expansion/initial/word.rs |
Modified test modules to use BracedParam and updated parameter creation logic in tests. |
yash-syntax/CHANGELOG.md |
Added information on new const functions, Param struct introduction, and updates to RawParam and BracedParam fields. |
yash-syntax/src/parser/error.rs |
Introduced InvalidParam error variant and corresponding error message handling. |
yash-syntax/src/parser/from_str.rs |
Updated FromStr implementation to use BracedParam and updated test cases accordingly. |
yash-syntax/src/parser/lex.rs |
Exported is_single_char_name from raw_param and added const qualifiers to certain functions. |
yash-syntax/src/parser/lex/braced_param.rs |
Introduced BracedParam , ParamType , and SpecialParam , and updated parsing logic for various parameter types. |
yash-syntax/src/parser/lex/dollar.rs |
Updated tests to use param for TextUnit::RawParam and adjusted assertions in tests. |
yash-syntax/src/parser/lex/raw_param.rs |
Refactored functions to be const , updated logic to handle special parameters, and adjusted test cases accordingly. |
No sequence diagrams are provided as the changes are primarily structural and involve refactoring and improving existing components without introducing new features or altering control flow significantly.
> In the land of code where parameters roam,
> A change was made to give them a home.
> No more a name, now a `Param` they wear,
> With structured logic and errors laid bare.
> The shell now speaks with messages clear,
> As the syntax dances with not a fear.
> Hooray for the code, refined and bright,
> A rabbit's touch to set things right! 🐇
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?
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
name
fields withparam
fields in various error structures.Chores